max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
leetcode/algorithm/integer_inversion.py
ftconan/python3
1
6627251
""" @author: magician @date: 2019/12/18 @file: sum_of_two.py """ import sys def reverse(x): """ reverse :param x: :return: """ new_x = 0 if isinstance(x, int): try: new_x = int(str(abs(x))[::-1]) if x < 0: new_x = -new_x ...
""" @author: magician @date: 2019/12/18 @file: sum_of_two.py """ import sys def reverse(x): """ reverse :param x: :return: """ new_x = 0 if isinstance(x, int): try: new_x = int(str(abs(x))[::-1]) if x < 0: new_x = -new_x ...
en
0.51031
@author: magician @date: 2019/12/18 @file: sum_of_two.py reverse :param x: :return: # [−231, 231 − 1] python int max(9223372036854775807)
3.827171
4
cytomine-datamining/algorithms/counting/setup.py
Cytomine-ULiege/Cytomine-python-datamining
0
6627252
# -*- coding: utf-8 -*- from setuptools import setup setup( name='CellCounting', version='0.1', author='<NAME>', author_email='<EMAIL>', packages=['cell_counting', 'cell_counting.validation'], install_requires=['numpy', 'scikit-learn', 'scipy', 'keras', 'shapely', 'joblib'] )
# -*- coding: utf-8 -*- from setuptools import setup setup( name='CellCounting', version='0.1', author='<NAME>', author_email='<EMAIL>', packages=['cell_counting', 'cell_counting.validation'], install_requires=['numpy', 'scikit-learn', 'scipy', 'keras', 'shapely', 'joblib'] )
en
0.769321
# -*- coding: utf-8 -*-
0.908239
1
pybullet-gym/pybulletgym/envs/mujoco/robots/robot_bases.py
SmaleZ/vcl_diayn
0
6627253
import pybullet import gym, gym.spaces, gym.utils import numpy as np import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) os.sys.path.insert(0,parentdir) class XmlBasedRobot: """ Base class for mujoco .xml based agents. ""...
import pybullet import gym, gym.spaces, gym.utils import numpy as np import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) os.sys.path.insert(0,parentdir) class XmlBasedRobot: """ Base class for mujoco .xml based agents. ""...
en
0.867601
Base class for mujoco .xml based agents. # streamline the case where bodies is actually just one body # limits = %+0.2f..%+0.2f effort=%0.3f speed=%0.3f" % ((joint_name,) + j.limits()) ) # if nothing else works, we take this as robot_body # some of the robots (Hopper, Walker2D and HalfCheetah in mujoco) require read-ac...
2.225717
2
dodgy_main/login.py
codingPaulStuart/python-carGUI
0
6627254
# 4PINT Assessment 2 - <NAME> 000389223 # Login Class # 16.06.21 import tkinter as tk from abc import abstractmethod from tkinter import messagebox, END class Login: __correct_cred = False __correct_user = "" __correct_pw = "" @classmethod def set_correct_cred(cls, bool_val): ...
# 4PINT Assessment 2 - <NAME> 000389223 # Login Class # 16.06.21 import tkinter as tk from abc import abstractmethod from tkinter import messagebox, END class Login: __correct_cred = False __correct_user = "" __correct_pw = "" @classmethod def set_correct_cred(cls, bool_val): ...
en
0.400286
# 4PINT Assessment 2 - <NAME> 000389223 # Login Class # 16.06.21 # row configure # column configure # defining widgets # defining grid # Binding Functions to buttons
3.452575
3
dbPGClass.py
iammortimer/TN-ARRR-Gateway
0
6627255
<reponame>iammortimer/TN-ARRR-Gateway import psycopg2 as pgdb from psycopg2 import sql from psycopg2 import pool from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT from datetime import timedelta import datetime import os class dbPGCalls(object): def __init__(self, config): self.config = config ...
import psycopg2 as pgdb from psycopg2 import sql from psycopg2 import pool from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT from datetime import timedelta import datetime import os class dbPGCalls(object): def __init__(self, config): self.config = config try: self.psPool = p...
en
0.363251
#self.dbCon = pgdb.connect(database=config['main']['name'], user=self.config["postgres"]["pguser"], password=self.config["<PASSWORD>"]["<PASSWORD>"], host=self.config["postgres"]["pghost"], port=self.config["postgres"]["pgport"]) #self.dbCon.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT) #self.dbCon = pgdb.connect(dat...
2.929452
3
qa/setup_packages.py
rbetz/DALI
0
6627256
#!/usr/bin/env python from __future__ import print_function, division import argparse import sys try: import pip._internal.pep425tags as p except: import pip.pep425tags as p try: # For Python 3.0 and later from urllib.request import urlopen, HTTPError, Request except ImportError: # Fall back to Pyth...
#!/usr/bin/env python from __future__ import print_function, division import argparse import sys try: import pip._internal.pep425tags as p except: import pip.pep425tags as p try: # For Python 3.0 and later from urllib.request import urlopen, HTTPError, Request except ImportError: # Fall back to Pyth...
en
0.815305
#!/usr/bin/env python # For Python 3.0 and later # Fall back to Python 2's urllib2 # keeps names of all required packages as a dict key # required versions are list or dict with keys of CUDA version, to use default just put None # instead of version number, direct link can be used # put {0} in pacage link as a placehol...
2.080653
2
venv/lib/python2.7/site-packages/ndb/query_test.py
anuja1011/Pick-Up-Sports
0
6627257
<reponame>anuja1011/Pick-Up-Sports # # Copyright 2008 The ndb Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
# # Copyright 2008 The ndb Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
en
0.790732
# # Copyright 2008 The ndb Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
2.103204
2
oauth_provider/views.py
philipforget/django-oauth-plus
0
6627258
from urllib import urlencode from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth import authenticate from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseRedirect from django.views.decorators.csrf import csrf_exempt from django.utils....
from urllib import urlencode from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth import authenticate from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseRedirect from django.views.decorators.csrf import csrf_exempt from django.utils....
en
0.72705
# try to get custom callback view # try to treat it as Class Based View (CBV) # if it appears not to be CBV treat it like FBV # try to get custom authorize view # try to treat it as Class Based View (CBV) # if it appears not to be CBV treat it like FBV # set the oauth flag # Consumer # Check Parameters # Check Request ...
2.030676
2
tests/test_loader.py
fossabot/chaostoolkit-lib
0
6627259
# -*- coding: utf-8 -*- import json import pytest import requests_mock from chaoslib.exceptions import InvalidSource from chaoslib.loader import load_experiment from chaoslib.types import Settings def test_load_from_file(generic_experiment: str): try: load_experiment(generic_experiment) except Invali...
# -*- coding: utf-8 -*- import json import pytest import requests_mock from chaoslib.exceptions import InvalidSource from chaoslib.loader import load_experiment from chaoslib.types import Settings def test_load_from_file(generic_experiment: str): try: load_experiment(generic_experiment) except Invali...
en
0.769321
# -*- coding: utf-8 -*-
2.267242
2
python/tako/client/exception.py
vyomkeshj/tako
0
6627260
class TakoException(Exception): pass class TaskFailed(TakoException): pass
class TakoException(Exception): pass class TaskFailed(TakoException): pass
none
1
1.262175
1
tests/scripts/thread-cert/mesh_cop.py
BenShen98/ot-playground
1
6627261
#!/usr/bin/env python3 # # Copyright (c) 2019, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
#!/usr/bin/env python3 # # Copyright (c) 2019, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
en
0.582247
#!/usr/bin/env python3 # # Copyright (c) 2019, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
1.246519
1
core/management/commands/showscripts.py
the-deep/DEEPL
6
6627262
import subprocess import re from django.core.management.base import BaseCommand class Command(BaseCommand): help = "Command to list available scripts to be run by command 'runscript'" def add_arguments(self, parser): # nothing to do here pass def handle(self, *args, **options): ...
import subprocess import re from django.core.management.base import BaseCommand class Command(BaseCommand): help = "Command to list available scripts to be run by command 'runscript'" def add_arguments(self, parser): # nothing to do here pass def handle(self, *args, **options): ...
en
0.960739
# nothing to do here # f is bytes
2.346319
2
src/03-network/3_mqtt_client.py
davidalexisnyt/micropython-workshop
3
6627263
import network from umqtt.robust import MQTTClient import secrets wifi = network.WLAN(network.STA_IF) wifi.active(True) wifi.connect(secrets.wifi_network, secrets.wifi_password) while not wifi.isconnected(): pass # Define some identifying information for our sensor node DEVICE_ID = 'sensor1' # Connect to the MQ...
import network from umqtt.robust import MQTTClient import secrets wifi = network.WLAN(network.STA_IF) wifi.active(True) wifi.connect(secrets.wifi_network, secrets.wifi_password) while not wifi.isconnected(): pass # Define some identifying information for our sensor node DEVICE_ID = 'sensor1' # Connect to the MQ...
en
0.80722
# Define some identifying information for our sensor node # Connect to the MQTT broker
3.208906
3
usaspending_api/broker/helpers/set_legal_entity_boolean_fields.py
g4brielvs/usaspending-api
217
6627264
from usaspending_api.broker.helpers.build_business_categories_boolean_dict import build_business_categories_boolean_dict def set_legal_entity_boolean_fields(row): """ in place updates to specific fields to be mapped as booleans """ legal_entity_bool_dict = build_business_categories_boolean_dict(row) for k...
from usaspending_api.broker.helpers.build_business_categories_boolean_dict import build_business_categories_boolean_dict def set_legal_entity_boolean_fields(row): """ in place updates to specific fields to be mapped as booleans """ legal_entity_bool_dict = build_business_categories_boolean_dict(row) for k...
en
0.942111
in place updates to specific fields to be mapped as booleans
2.02352
2
hyper/ssl_compat.py
chripede/hyper
0
6627265
# -*- coding: utf-8 -*- """ hyper/ssl_compat ~~~~~~~~~ Shoves pyOpenSSL into an API that looks like the standard Python 3.x ssl module. Currently exposes exactly those attributes, classes, and methods that we actually use in hyper (all method signatures are complete, however). May be expanded to something more genera...
# -*- coding: utf-8 -*- """ hyper/ssl_compat ~~~~~~~~~ Shoves pyOpenSSL into an API that looks like the standard Python 3.x ssl module. Currently exposes exactly those attributes, classes, and methods that we actually use in hyper (all method signatures are complete, however). May be expanded to something more genera...
en
0.895008
# -*- coding: utf-8 -*- hyper/ssl_compat ~~~~~~~~~ Shoves pyOpenSSL into an API that looks like the standard Python 3.x ssl module. Currently exposes exactly those attributes, classes, and methods that we actually use in hyper (all method signatures are complete, however). May be expanded to something more general-pu...
2.55691
3
MainRunNumber.py
tokyohost/Download-Thz-Torrent
4
6627266
<reponame>tokyohost/Download-Thz-Torrent<filename>MainRunNumber.py #!/usr/bin/python # -*- coding: utf-8 -*- def MainRunNumber(NowNumber): #统计共爬取多少 个页面 MainRunNumber = NowNumber MainRunNumber += 1 return MainRunNumber
#!/usr/bin/python # -*- coding: utf-8 -*- def MainRunNumber(NowNumber): #统计共爬取多少 个页面 MainRunNumber = NowNumber MainRunNumber += 1 return MainRunNumber
zh
0.510918
#!/usr/bin/python # -*- coding: utf-8 -*- #统计共爬取多少 个页面
2.87526
3
home_town_finder/__init__.py
ThorsHamster/find_new_hometown
2
6627267
from .home_town_finder import HomeTownFinder __all__ = ["HomeTownFinder"]
from .home_town_finder import HomeTownFinder __all__ = ["HomeTownFinder"]
none
1
1.074005
1
profiles/migrations/0004_auto_20180727_1823.py
vkendurkar/StudentCouncil
1
6627268
<filename>profiles/migrations/0004_auto_20180727_1823.py # Generated by Django 2.0.6 on 2018-07-27 12:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('profiles', '0003_auto_20180727_1756'), ] operations = [ migrations.AlterField( ...
<filename>profiles/migrations/0004_auto_20180727_1823.py # Generated by Django 2.0.6 on 2018-07-27 12:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('profiles', '0003_auto_20180727_1756'), ] operations = [ migrations.AlterField( ...
en
0.681843
# Generated by Django 2.0.6 on 2018-07-27 12:53
1.464398
1
cloudsplaining/scan/statement_detail.py
gruebel/cloudsplaining
3
6627269
"""Abstracts evaluation of IAM Policy statements.""" import logging from cached_property import cached_property from policy_sentry.analysis.analyze import determine_actions_to_expand from policy_sentry.querying.actions import ( remove_actions_not_matching_access_level, get_actions_matching_arn, ) from policy_...
"""Abstracts evaluation of IAM Policy statements.""" import logging from cached_property import cached_property from policy_sentry.analysis.analyze import determine_actions_to_expand from policy_sentry.querying.actions import ( remove_actions_not_matching_access_level, get_actions_matching_arn, ) from policy_...
en
0.867788
Abstracts evaluation of IAM Policy statements. # Copyright (c) 2020, salesforce.<EMAIL>, inc. # All rights reserved. # Licensed under the BSD 3-Clause license. # For full license text, see the LICENSE file in the repo root # or https://opensource.org/licenses/BSD-3-Clause # pylint: disable=too-many-instance-attributes ...
1.951694
2
gloro/lipschitz_computation.py
klasleino/gloro
16
6627270
import tensorflow as tf from tensorflow.keras.layers import Add from tensorflow.keras.layers import AveragePooling2D import gloro from gloro.layers.network_layers import ResnetBlock from gloro.utils import l2_normalize class LipschitzComputer(object): def __init__(self, layer, *args, **kwargs): self._...
import tensorflow as tf from tensorflow.keras.layers import Add from tensorflow.keras.layers import AveragePooling2D import gloro from gloro.layers.network_layers import ResnetBlock from gloro.utils import l2_normalize class LipschitzComputer(object): def __init__(self, layer, *args, **kwargs): self._...
en
0.891974
# TODO: this is a little less nice than reading a `_gloro_branch` # property, but it persists by default when the layers are saved, # whereas we would need extra instrumentation to save the # `_gloro_branch` property. Ultimately we should probably pick # just one method (either name-based or property-based). # ...
2.440179
2
src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/polly_stack.py
kaichengyan/amplify-ci-support
0
6627271
<reponame>kaichengyan/amplify-ci-support<filename>src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/polly_stack.py from aws_cdk import aws_iam, aws_s3, core from common.common_stack import CommonStack from common.platforms import Platform from common.region_aware_stack import RegionAwareStack ...
from aws_cdk import aws_iam, aws_s3, core from common.common_stack import CommonStack from common.platforms import Platform from common.region_aware_stack import RegionAwareStack class PollyStack(RegionAwareStack): def __init__(self, scope: core.Construct, id: str, common_stack: CommonStack, **kwargs) -> None: ...
none
1
1.851087
2
source/modules/synt/basic_algorithms.py
SyntLang/SyntPy
0
6627272
<filename>source/modules/synt/basic_algorithms.py # Basic Synt Algorithms # version def version(self, *args): # check if run_status is run if self.run_status == "run": pass else: return print(f"Running Synt v{self.ver}") # comment def comment(self, *args): pass # output def output(self, *...
<filename>source/modules/synt/basic_algorithms.py # Basic Synt Algorithms # version def version(self, *args): # check if run_status is run if self.run_status == "run": pass else: return print(f"Running Synt v{self.ver}") # comment def comment(self, *args): pass # output def output(self, *...
en
0.55093
# Basic Synt Algorithms # version # check if run_status is run # comment # output # check if run_status is run # input # check if run_status is run # get output # input statement # throw error if output variable is not defined # take input # set output variable data # set output variable # end # check if run_status is ...
2.916799
3
models/company.py
AlberLC/qt-app
0
6627273
from sqlalchemy import Table, Column, Integer, Float, String, Boolean, Date, ForeignKey from sqlalchemy.orm import relationship from models import Base from utilities.various import normalize rel_company_company_type = Table( 'rel_company_company_type', Base.metadata, Column('company_id', Integer, Foreign...
from sqlalchemy import Table, Column, Integer, Float, String, Boolean, Date, ForeignKey from sqlalchemy.orm import relationship from models import Base from utilities.various import normalize rel_company_company_type = Table( 'rel_company_company_type', Base.metadata, Column('company_id', Integer, Foreign...
en
0.521254
# self.staff = data[40]
2.505332
3
cembot/commands/given.py
niksart/cembot
0
6627274
<filename>cembot/commands/given.py from utils import auxiliary_functions import time import logging def given(bot, user, chat, args, dbman, LANG, currency, parse_mode): payer_id = int(user["id"]) if len(args) < 3: bot.sendMessage(chat["id"], LANG["helper_commands"]["GIVEN"], parse_mode=parse_mode) return try:...
<filename>cembot/commands/given.py from utils import auxiliary_functions import time import logging def given(bot, user, chat, args, dbman, LANG, currency, parse_mode): payer_id = int(user["id"]) if len(args) < 3: bot.sendMessage(chat["id"], LANG["helper_commands"]["GIVEN"], parse_mode=parse_mode) return try:...
en
0.936848
# if payee has not authorized the payer exit
2.196568
2
client/rule_based_common_nlg.py
ricosr/travel_consult_chatbot
0
6627275
<reponame>ricosr/travel_consult_chatbot # -*- coding: utf-8 -*- import random import re psychobabble = [ # [r'我需要(.*)', # ["为什么你需要 {0}?", # "它真的会帮助你获得 {0}?", # "你确定你需要 {0}?"]], [r'你好(.*)啊', ["(✿◡‿◡)", "/::$/::$", "[Smirk][Smirk]"]], [r'你好', ["你好❤️, 请输入 咨询,景点,或订票。"...
# -*- coding: utf-8 -*- import random import re psychobabble = [ # [r'我需要(.*)', # ["为什么你需要 {0}?", # "它真的会帮助你获得 {0}?", # "你确定你需要 {0}?"]], [r'你好(.*)啊', ["(✿◡‿◡)", "/::$/::$", "[Smirk][Smirk]"]], [r'你好', ["你好❤️, 请输入 咨询,景点,或订票。"]], [r'我不想和你说话(.*)', ["不想和我干什...
en
0.243662
# -*- coding: utf-8 -*- # [r'我需要(.*)', # ["为什么你需要 {0}?", # "它真的会帮助你获得 {0}?", # "你确定你需要 {0}?"]], # [r'我饿了', # ["给你小蛋糕🍰🎂两种口味哦~", # "饿了就去吃啊,还玩啥微信啊"]], # [r'再见', # ["谢谢你跟我说话.", # "再见─=≡Σ(((つ•̀ω•́)つ", # "谢谢,祝你有美好的一天!"]], # [r'(.*)吃(.*)', # ['吃吃吃,总想着吃会很胖的', # '胖子,别吃啦']], # # [r'(.*)', # ['@$@']] # class Eli...
2.551093
3
tests/test_looseserver/default/client/response/test_create_response_factory.py
KillAChicken/loose-server
3
6627276
<reponame>KillAChicken/loose-server """Test cases for creation of the default response factory.""" from looseserver.default.client.rule import create_rule_factory, MethodRule from looseserver.default.client.response import create_response_factory, FixedResponse from looseserver.client.flask import FlaskClient def te...
"""Test cases for creation of the default response factory.""" from looseserver.default.client.rule import create_rule_factory, MethodRule from looseserver.default.client.response import create_response_factory, FixedResponse from looseserver.client.flask import FlaskClient def test_create_response_factory( ...
en
0.896434
Test cases for creation of the default response factory. Check that default responses are registered in the default response factory. 1. Configure application with default factories. 2. Create default response factory for client. 3. Create a method rule with the client. 4. Set a fixed response with the...
2.404872
2
locationandfeedback/migrations/0003_auto_20210227_2109.py
singh-sushil/minorproject
2
6627277
<gh_stars>1-10 # Generated by Django 3.1.1 on 2021-02-27 15:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('locationandfeedback', '0002_rateapp'), ] operations = [ migrations.AddField( model_name='feedback', ...
# Generated by Django 3.1.1 on 2021-02-27 15:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('locationandfeedback', '0002_rateapp'), ] operations = [ migrations.AddField( model_name='feedback', na...
en
0.794709
# Generated by Django 3.1.1 on 2021-02-27 15:24
1.569305
2
setup.py
Cray-HPE/canu
6
6627278
<reponame>Cray-HPE/canu # MIT License # # (C) Copyright [2022] Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including witho...
# MIT License # # (C) Copyright [2022] Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the righ...
en
0.743102
# MIT License # # (C) Copyright [2022] Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the righ...
1.271954
1
mayan/apps/document_states/views/workflow_template_views.py
O2Graphics/Mayan-EDMS
0
6627279
from __future__ import absolute_import, unicode_literals from django.contrib import messages from django.db import transaction from django.template import RequestContext from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from mayan.apps.common.generics import ( AddRemoveV...
from __future__ import absolute_import, unicode_literals from django.contrib import messages from django.db import transaction from django.template import RequestContext from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from mayan.apps.common.generics import ( AddRemoveV...
none
1
1.8122
2
co2mini/meter.py
jerr0328/co2-mini
0
6627280
<gh_stars>0 """ Module for reading out CO2Meter USB devices Code adapted from <NAME> under MIT License: https://github.com/heinemml/CO2Meter """ import fcntl import logging import threading CO2METER_CO2 = 0x50 CO2METER_TEMP = 0x42 CO2METER_HUM = 0x41 HIDIOCSFEATURE_9 = 0xC0094806 logger = logging.getLogger(__name__) ...
""" Module for reading out CO2Meter USB devices Code adapted from <NAME> under MIT License: https://github.com/heinemml/CO2Meter """ import fcntl import logging import threading CO2METER_CO2 = 0x50 CO2METER_TEMP = 0x42 CO2METER_HUM = 0x41 HIDIOCSFEATURE_9 = 0xC0094806 logger = logging.getLogger(__name__) def _conve...
en
0.822501
Module for reading out CO2Meter USB devices Code adapted from <NAME> under MIT License: https://github.com/heinemml/CO2Meter Apply Conversion of value dending on sensor type Helper function for printing the raw data Function that reads from the device, decodes it, validates the checksum and adds the data to the...
3.129213
3
django/db/migrations/writer.py
brylie/django
1
6627281
<reponame>brylie/django from __future__ import unicode_literals import datetime import inspect import decimal import collections from importlib import import_module import os import sys import types from django.apps import apps from django.db import models, migrations from django.db.migrations.loader import Migration...
from __future__ import unicode_literals import datetime import inspect import decimal import collections from importlib import import_module import os import sys import types from django.apps import apps from django.db import models, migrations from django.db.migrations.loader import MigrationLoader from django.utils...
en
0.801303
Special subclass of string which actually references a current settings value. It's treated as the value in memory, but serializes out to a settings.NAME attribute reference. # See if this operation is in django.db.migrations. If it is, # We can just use the fact we already have that imported, # otherwise, we n...
2.168098
2
torch_edit_distance/__init__.py
1ytic/pytorch-edit-distance
77
6627282
<reponame>1ytic/pytorch-edit-distance import torch import torch_edit_distance_cuda as core from pkg_resources import get_distribution __version__ = get_distribution('torch_edit_distance').version def collapse_repeated( sequences, # type: torch.Tensor lengths # type: torch.IntTensor ): ...
import torch import torch_edit_distance_cuda as core from pkg_resources import get_distribution __version__ = get_distribution('torch_edit_distance').version def collapse_repeated( sequences, # type: torch.Tensor lengths # type: torch.IntTensor ): """Merge repeated tokens. Sequen...
en
0.776224
# type: torch.Tensor # type: torch.IntTensor Merge repeated tokens. Sequences and lengths tensors will be modified inplace. Args: sequences (torch.Tensor): Tensor (N, T) where T is the maximum length of tokens from N sequences. lengths (torch.IntTensor): Tensor (N,) representing the ...
2.474823
2
solutions/python3/problem1213.py
tjyiiuan/LeetCode
0
6627283
<reponame>tjyiiuan/LeetCode<filename>solutions/python3/problem1213.py<gh_stars>0 # -*- coding: utf-8 -*- """ 1213. Intersection of Three Sorted Arrays Given three integer arrays arr1, arr2 and arr3 sorted in strictly increasing order, return a sorted array of only the integers that appeared in all three arrays. Const...
# -*- coding: utf-8 -*- """ 1213. Intersection of Three Sorted Arrays Given three integer arrays arr1, arr2 and arr3 sorted in strictly increasing order, return a sorted array of only the integers that appeared in all three arrays. Constraints: 1 <= arr1.length, arr2.length, arr3.length <= 1000 1 <= arr1[i], arr2[i]...
en
0.798535
# -*- coding: utf-8 -*- 1213. Intersection of Three Sorted Arrays Given three integer arrays arr1, arr2 and arr3 sorted in strictly increasing order, return a sorted array of only the integers that appeared in all three arrays. Constraints: 1 <= arr1.length, arr2.length, arr3.length <= 1000 1 <= arr1[i], arr2[i], ar...
3.867464
4
1_histogram/2_histogram_lane_pi_murtaza/sample-codes/MotorModule..py
masudpce/final-projec
1
6627284
<gh_stars>1-10 import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) class Motor(): def __init__(self,EnaA,In1A,In2A,EnaB,In1B,In2B): self.EnaA= EnaA self.In1A = In1A self.In2A = In2A self.EnaB= EnaB self.In1B = In1B self.I...
import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) class Motor(): def __init__(self,EnaA,In1A,In2A,EnaB,In1B,In2B): self.EnaA= EnaA self.In1A = In1A self.In2A = In2A self.EnaB= EnaB self.In1B = In1B self.In2B = In2B ...
en
0.598709
# todo: starnge value, need to check video # print(leftSpeed,rightSpeed)
3.217817
3
tests/test_metrics.py
louisfh/opensoundscape
30
6627285
<reponame>louisfh/opensoundscape #!/usr/bin/env python3 import pytest import numpy as np
#!/usr/bin/env python3 import pytest import numpy as np
fr
0.221828
#!/usr/bin/env python3
0.904044
1
pong/admin.py
vimm0/python_pong_scoreboard
0
6627286
<filename>pong/admin.py from django.contrib import admin from pong.models import Player, Match class PlayerAdmin(admin.ModelAdmin): list_display = ('name',) class MatchAdmin(admin.ModelAdmin): list_display = ('player_one', 'player_two') admin.site.register(Player, PlayerAdmin) admin.site.register(Match, MatchAd...
<filename>pong/admin.py from django.contrib import admin from pong.models import Player, Match class PlayerAdmin(admin.ModelAdmin): list_display = ('name',) class MatchAdmin(admin.ModelAdmin): list_display = ('player_one', 'player_two') admin.site.register(Player, PlayerAdmin) admin.site.register(Match, MatchAd...
none
1
1.994256
2
auxiliary/rastertolegend/rastertolegend.py
johnnyzhang295/MMGIS
63
6627287
<reponame>johnnyzhang295/MMGIS<filename>auxiliary/rastertolegend/rastertolegend.py import os import sys import subprocess from osgeo import gdal from pathlib import Path raster = sys.argv[1] splitfilenameR = os.path.splitext(raster) colorfile = sys.argv[2] splitfilenameC = os.path.basename(colorfile).split("....
import os import sys import subprocess from osgeo import gdal from pathlib import Path raster = sys.argv[1] splitfilenameR = os.path.splitext(raster) colorfile = sys.argv[2] splitfilenameC = os.path.basename(colorfile).split(".") discrete = "" values = [] if len(sys.argv) > 3: discrete = sys.argv[3]...
en
0.526424
# helper functions # stats[0] is min, stats[1] is max
2.698826
3
holoviews/tests/plotting/matplotlib/testpathplot.py
xavArtley/holoviews
1
6627288
import numpy as np from holoviews.core import NdOverlay from holoviews.core.spaces import HoloMap from holoviews.element import Polygons, Contours, Path from .testplot import TestMPLPlot, mpl_renderer class TestPathPlot(TestMPLPlot): def test_path_continuously_varying_color_op(self): xs = [1, 2, 3, 4] ...
import numpy as np from holoviews.core import NdOverlay from holoviews.core.spaces import HoloMap from holoviews.element import Polygons, Contours, Path from .testplot import TestMPLPlot, mpl_renderer class TestPathPlot(TestMPLPlot): def test_path_continuously_varying_color_op(self): xs = [1, 2, 3, 4] ...
none
1
2.141217
2
main.py
ekholabs/kaggle_mnist
0
6627289
import sys import json from model.mnist_cnn_classifier import MNISTCNNClassifier from utils.s3 import S3Utils if __name__ == '__main__': classifiers = {'cnn': MNISTCNNClassifier('model_output/cnn')} if len(sys.argv) < 2: print('Please, pass the model type you want to execute. for example, "cnn"') ...
import sys import json from model.mnist_cnn_classifier import MNISTCNNClassifier from utils.s3 import S3Utils if __name__ == '__main__': classifiers = {'cnn': MNISTCNNClassifier('model_output/cnn')} if len(sys.argv) < 2: print('Please, pass the model type you want to execute. for example, "cnn"') ...
none
1
2.708758
3
corehq/apps/app_manager/suite_xml/sections/resources.py
johan--/commcare-hq
0
6627290
<gh_stars>0 from corehq.apps.app_manager import id_strings from corehq.apps.app_manager.suite_xml.contributors import SectionContributor from corehq.apps.app_manager.suite_xml.xml_models import LocaleResource, XFormResource from corehq.apps.app_manager.templatetags.xforms_extras import trans from corehq.apps.app_manage...
from corehq.apps.app_manager import id_strings from corehq.apps.app_manager.suite_xml.contributors import SectionContributor from corehq.apps.app_manager.suite_xml.xml_models import LocaleResource, XFormResource from corehq.apps.app_manager.templatetags.xforms_extras import trans from corehq.apps.app_manager.util impor...
none
1
1.865753
2
scripts/proj2json.py
jjimenezshaw/crs-explorer
6
6627291
#!/usr/bin/env python import json import os import pyproj from contextlib import redirect_stdout if __name__ == '__main__': dest_dir = os.getenv('DEST_DIR', '.') dest_file = f'{dest_dir}/crslist.json' metadata_file = f'{dest_dir}/metadata.txt' pyproj.show_versions() with open(metadata_file, 'w'...
#!/usr/bin/env python import json import os import pyproj from contextlib import redirect_stdout if __name__ == '__main__': dest_dir = os.getenv('DEST_DIR', '.') dest_file = f'{dest_dir}/crslist.json' metadata_file = f'{dest_dir}/metadata.txt' pyproj.show_versions() with open(metadata_file, 'w'...
ru
0.26433
#!/usr/bin/env python
2.350067
2
cscs-checks/apps/jupyter/check_ipcmagic.py
toxa81/reframe
0
6627292
# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import reframe as rfm import reframe.utility.osext as osext import reframe.utility.sanity as sn from reframe.core.backends imp...
# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import reframe as rfm import reframe.utility.osext as osext import reframe.utility.sanity as sn from reframe.core.backends imp...
en
0.789575
# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause # FIXME: The following will not be needed after the Daint upgrade # Change the job launcher since `ipython` # needs to be launc...
1.839257
2
examples/pybullet/gym/pybullet_envs/minitaur/agents/baseline_controller/locomotion_controller_in_scenario_set_example.py
felipeek/bullet3
9,136
6627293
<gh_stars>1000+ r"""ScenarioSet example for Laikago MPC controller. blaze run -c opt \ //robotics/reinforcement_learning/minitaur/agents/baseline_controller\ :locomotion_controller_in_scenario_set_example -- --gait=slow_trot \ --add_random_push=True """ from absl import app from absl import flags import gin import nu...
r"""ScenarioSet example for Laikago MPC controller. blaze run -c opt \ //robotics/reinforcement_learning/minitaur/agents/baseline_controller\ :locomotion_controller_in_scenario_set_example -- --gait=slow_trot \ --add_random_push=True """ from absl import app from absl import flags import gin import numpy as np import...
en
0.317097
ScenarioSet example for Laikago MPC controller. blaze run -c opt \ //robotics/reinforcement_learning/minitaur/agents/baseline_controller\ :locomotion_controller_in_scenario_set_example -- --gait=slow_trot \ --add_random_push=True import pybullet_envs.minitaur.envs_v2.scenarios.locomotion_simple_scenario_set include "...
2.587359
3
example/iiko/test_modify_update.py
businka/HttpSniffer
0
6627294
<filename>example/iiko/test_modify_update.py import xml.etree.ElementTree as ET from uuid import uuid4 def parse_response_data(data): root = ET.fromstring(data.decode('utf-8')) items_node = root.find('./returnValue/items') order_number = '16' order_id = f'00000000-0000-0000-0000-00000000000{order_numb...
<filename>example/iiko/test_modify_update.py import xml.etree.ElementTree as ET from uuid import uuid4 def parse_response_data(data): root = ET.fromstring(data.decode('utf-8')) items_node = root.find('./returnValue/items') order_number = '16' order_id = f'00000000-0000-0000-0000-00000000000{order_numb...
en
0.286606
# if 'null' in entities_node.attrib: # a = 1 # else: # a = 2 01d0 35 31 2d 61 32 31 39 2d 66 61 62 30 36 36 66 62 51-a219-fab066fb
2.479245
2
convert_to_records.py
caiyueliang/MyAgeGenderEstimate
564
6627295
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
en
0.564417
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2.191235
2
venv/Lib/site-packages/torch/distributions/uniform.py
Westlanderz/AI-Plat1
1
6627296
from numbers import Number import torch from torch.distributions import constraints from torch.distributions.distribution import Distribution from torch.distributions.utils import broadcast_all class Uniform(Distribution): r""" Generates uniformly distributed random samples from the half-open inter...
from numbers import Number import torch from torch.distributions import constraints from torch.distributions.distribution import Distribution from torch.distributions.utils import broadcast_all class Uniform(Distribution): r""" Generates uniformly distributed random samples from the half-open inter...
en
0.614382
Generates uniformly distributed random samples from the half-open interval ``[low, high)``. Example:: >>> m = Uniform(torch.tensor([0.0]), torch.tensor([5.0])) >>> m.sample() # uniformly distributed in the range [0.0, 5.0) tensor([ 2.3418]) Args: low (float or T...
3.130079
3
hipotap_common/rpc/clients/order_rpc_client.py
leckijakub/hipotap
0
6627297
import pika from hipotap_common.proto_messages.hipotap_pb2 import BaseResponsePB from hipotap_common.proto_messages.order_pb2 import ( GetOrderRequestPB, OrderListPB, OrderPB, OrderPaymentRequestPB, TrendListPB, ) from hipotap_common.queues.order_queues import ( GET_ORDER_QUEUE, GET_TRENDS_Q...
import pika from hipotap_common.proto_messages.hipotap_pb2 import BaseResponsePB from hipotap_common.proto_messages.order_pb2 import ( GetOrderRequestPB, OrderListPB, OrderPB, OrderPaymentRequestPB, TrendListPB, ) from hipotap_common.queues.order_queues import ( GET_ORDER_QUEUE, GET_TRENDS_Q...
en
0.789524
# Send request # Wait for response # Send request # Wait for response # Send request # Wait for response # Send request # Wait for response # Send request # Wait for response
2.056366
2
docs/tutorials_torch/action_recognition/demo_i3d_kinetics400.py
Kh4L/gluon-cv
1
6627298
<gh_stars>1-10 """1. Getting Started with Pre-trained I3D Models on Kinetcis400 ================================================================ `Kinetics400 <https://deepmind.com/research/open-source/kinetics>`_ is an action recognition dataset of realistic action videos, collected from YouTube. With 306,245 short t...
"""1. Getting Started with Pre-trained I3D Models on Kinetcis400 ================================================================ `Kinetics400 <https://deepmind.com/research/open-source/kinetics>`_ is an action recognition dataset of realistic action videos, collected from YouTube. With 306,245 short trimmed videos f...
en
0.663509
1. Getting Started with Pre-trained I3D Models on Kinetcis400 ================================================================ `Kinetics400 <https://deepmind.com/research/open-source/kinetics>`_ is an action recognition dataset of realistic action videos, collected from YouTube. With 306,245 short trimmed videos from...
3.121631
3
archive/boston/vote.py
jayktee/scrapers-us-municipal
67
6627299
from pupa.scrape import Scraper from pupa.scrape import Vote import datetime as dt import lxml import time DURL = "http://www.cityofboston.gov/cityclerk/rollcall/default.aspx" class BostonVoteScraper(Scraper): def lxmlize(self, url): entry = self.urlopen(url) page = lxml.html.fromstring(entry)...
from pupa.scrape import Scraper from pupa.scrape import Vote import datetime as dt import lxml import time DURL = "http://www.cityofboston.gov/cityclerk/rollcall/default.aspx" class BostonVoteScraper(Scraper): def lxmlize(self, url): entry = self.urlopen(url) page = lxml.html.fromstring(entry)...
none
1
2.984545
3
user/views.py
Emmanuel-code/Questions-Answers
0
6627300
from django.contrib.auth import authenticate,login from .forms import SignUpForm,UpdateProfileForm from .models import Profile from django.shortcuts import render,redirect,get_object_or_404 from django.contrib.auth.decorators import login_required @login_required def edit_profile(request): if request.method=='PO...
from django.contrib.auth import authenticate,login from .forms import SignUpForm,UpdateProfileForm from .models import Profile from django.shortcuts import render,redirect,get_object_or_404 from django.contrib.auth.decorators import login_required @login_required def edit_profile(request): if request.method=='PO...
none
1
2.191397
2
lib/sensor.py
wizgrav/protobot
1
6627301
<filename>lib/sensor.py import pigpio class Sensor: ax=0 ay=0 az=0 mx=0 my=0 mz=0 def __init__(self, pi): self.pi = pi self.acc = self.pi.i2c_open(1, 0x19, 0) self.pi.i2c_write_byte_data(self.acc,0x20,0x37) self.mag = self.pi.i2c_open(1, 0x1e, 0) ...
<filename>lib/sensor.py import pigpio class Sensor: ax=0 ay=0 az=0 mx=0 my=0 mz=0 def __init__(self, pi): self.pi = pi self.acc = self.pi.i2c_open(1, 0x19, 0) self.pi.i2c_write_byte_data(self.acc,0x20,0x37) self.mag = self.pi.i2c_open(1, 0x1e, 0) ...
none
1
2.903282
3
pyfiction/examples/starcourt/lstm_online.py
FPreta/pyfiction
32
6627302
import logging from keras.optimizers import RMSprop from keras.utils import plot_model from pyfiction.agents.ssaqn_agent import SSAQNAgent from pyfiction.simulators.games.starcourt_simulator import StarCourtSimulator logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) """ An example SSAQN a...
import logging from keras.optimizers import RMSprop from keras.utils import plot_model from pyfiction.agents.ssaqn_agent import SSAQNAgent from pyfiction.simulators.games.starcourt_simulator import StarCourtSimulator logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) """ An example SSAQN a...
en
0.867206
An example SSAQN agent for Star Court that uses online learning and prioritized sampling # Create the agent and specify maximum lengths of descriptions (in words) # Learn the vocabulary (the function samples the game using a random policy) # Visualize the model # Iteratively train the agent on a batch of previously see...
2.64562
3
example/server/integrations.py
lijamie98/django-polaris
0
6627303
<reponame>lijamie98/django-polaris<gh_stars>0 import json from smtplib import SMTPException from decimal import Decimal from typing import List, Dict, Optional, Tuple from urllib.parse import urlencode from base64 import b64encode from collections import defaultdict from logging import getLogger from django.db.models ...
import json from smtplib import SMTPException from decimal import Decimal from typing import List, Dict, Optional, Tuple from urllib.parse import urlencode from base64 import b64encode from collections import defaultdict from logging import getLogger from django.db.models import QuerySet from django.core.exceptions im...
en
0.894118
Sends a confirmation email to user.email In a real production deployment, you would never want to send emails as part of the request/response cycle. Instead, use a job queue service like Celery. This reference server is not intended to handle heavy traffic so we are making an exception here. # email bo...
1.978223
2
jobs/appointment_reminder/send_email_reminder.py
saravanpa-aot/queue-management
0
6627304
<filename>jobs/appointment_reminder/send_email_reminder.py # Copyright © 2019 Province of British Columbia # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
<filename>jobs/appointment_reminder/send_email_reminder.py # Copyright © 2019 Province of British Columbia # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
en
0.829123
# Copyright © 2019 Province of British Columbia # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
2.260562
2
script.py
GSPuniani/automated-greenhouse-forms
0
6627305
<reponame>GSPuniani/automated-greenhouse-forms # Web form automation from selenium import webdriver from selenium.webdriver.firefox.firefox_binary import FirefoxBinary from selenium.webdriver.support.ui import Select # Accessing environment variables import os import yaml # Chromedriver chromedriver_location = f"/Us...
# Web form automation from selenium import webdriver from selenium.webdriver.firefox.firefox_binary import FirefoxBinary from selenium.webdriver.support.ui import Select # Accessing environment variables import os import yaml # Chromedriver chromedriver_location = f"/Users/{os.environ['USER']}/Downloads/chromedriver...
en
0.695914
# Web form automation # Accessing environment variables # Chromedriver # browser = webdriver.Safari() # binary = FirefoxBinary('path/to/installed firefox binary') # browser = webdriver.Firefox(firefox_binary=binary) # Retrieve info from YAML file # Job Application URL # First Name # Last Name # Email # Phone # City # L...
2.556002
3
homeassistant/components/ais_google_home/const.py
stravinci/AIS-home-assistant
5
6627306
<reponame>stravinci/AIS-home-assistant<filename>homeassistant/components/ais_google_home/const.py """Constants for the ais_google_home.""" DOMAIN = "ais_google_home" CONF_OAUTH_JSON = "oauth_json"
"""Constants for the ais_google_home.""" DOMAIN = "ais_google_home" CONF_OAUTH_JSON = "oauth_json"
en
0.398215
Constants for the ais_google_home.
0.994987
1
src/components/fakedata/__init__.py
phong10119/sever-freshfarm
1
6627307
<filename>src/components/fakedata/__init__.py from src.models.user import db, User, OAuth, Token, Order, Order_item, Order_status from src.models.product import Product, Inventory, Rating, Category from src.models.trading import Shipment, Invoice, Invoice_status, Payment import random from flask import Blueprint , ren...
<filename>src/components/fakedata/__init__.py from src.models.user import db, User, OAuth, Token, Order, Order_item, Order_status from src.models.product import Product, Inventory, Rating, Category from src.models.trading import Shipment, Invoice, Invoice_status, Payment import random from flask import Blueprint , ren...
en
0.355836
# for el in categories: # new_cate = Category(body=el) # db.session.add(new_cate) # db.session.commit() # for el in inventories: # new_i = Inventory(location=el) # db.session.add(new_i) # db.session.commit() # for el in order_status: # new_os = Order_status(status=el) # db.session.add(ne...
2.094629
2
ravel/mndeps.py
mudbri/Faure
1
6627308
<filename>ravel/mndeps.py """ Creating topologies from command-line parameters. """ import os import re from ravel.util import splitArgs from topo.topolib import (EmptyTopo, SingleSwitchTopo, SingleSwitchReversedTopo, MinimalTopo, LinearTopo, TreeTopo, FatTreeTopo, ISPTopo) TOPOS = { "empty": EmptyTopo, "m...
<filename>ravel/mndeps.py """ Creating topologies from command-line parameters. """ import os import re from ravel.util import splitArgs from topo.topolib import (EmptyTopo, SingleSwitchTopo, SingleSwitchReversedTopo, MinimalTopo, LinearTopo, TreeTopo, FatTreeTopo, ISPTopo) TOPOS = { "empty": EmptyTopo, "m...
en
0.126303
Creating topologies from command-line parameters. Set custom parameters for Mininet name: parameter name value: parameter value Parse custom parameters value: string containing custom parameters Build topology from string with format (object, arg1, arg2,...). topoStr: topology string
2.715892
3
bruhat/extern/todd_coxeter.py
punkdit/bruhat
3
6627309
<reponame>punkdit/bruhat<gh_stars>1-10 #!/usr/bin/env python3 # From: https://math.berkeley.edu/~kmill/notes/todd_coxeter.html # Example of Todd-Coxeter to compute S_3 from relations idents = [] neighbors = [] to_visit = 0 ngens = 2 rels = [ (1, 0), # a^-1a (3, 2), # b^-1b (0, 0, 0), #a^3 (2, 2), #...
#!/usr/bin/env python3 # From: https://math.berkeley.edu/~kmill/notes/todd_coxeter.html # Example of Todd-Coxeter to compute S_3 from relations idents = [] neighbors = [] to_visit = 0 ngens = 2 rels = [ (1, 0), # a^-1a (3, 2), # b^-1b (0, 0, 0), #a^3 (2, 2), # b^2 (0, 2, 0, 2) # abab ] hgens = ...
en
0.455077
#!/usr/bin/env python3 # From: https://math.berkeley.edu/~kmill/notes/todd_coxeter.html # Example of Todd-Coxeter to compute S_3 from relations # a^-1a # b^-1b #a^3 # b^2 # abab # b
3.010001
3
tests/test_ops.py
Kyle-Kyle/angr
6
6627310
<filename>tests/test_ops.py import angr import claripy import archinfo # all the input values were generated via # [random.randrange(256) for _ in range(16)] # then set into the input registers via gdb # set $xmm0.v16_int8 = {...} # then read out as uint128s # p/x $xmm0.uint128 # then single stepped and the result rea...
<filename>tests/test_ops.py import angr import claripy import archinfo # all the input values were generated via # [random.randrange(256) for _ in range(16)] # then set into the input registers via gdb # set $xmm0.v16_int8 = {...} # then read out as uint128s # p/x $xmm0.uint128 # then single stepped and the result rea...
en
0.773155
# all the input values were generated via # [random.randrange(256) for _ in range(16)] # then set into the input registers via gdb # set $xmm0.v16_int8 = {...} # then read out as uint128s # p/x $xmm0.uint128 # then single stepped and the result read out # concrete test # symbolic test # concrete test # concrete test
1.904748
2
sample3.py
vswamy/python
0
6627311
<reponame>vswamy/python #Learning Python import os ## to use list as a stack, use append and pop operations list = [1,2,3] print(list) list.pop() print(list) list.append(4) print(list)
#Learning Python import os ## to use list as a stack, use append and pop operations list = [1,2,3] print(list) list.pop() print(list) list.append(4) print(list)
en
0.892967
#Learning Python ## to use list as a stack, use append and pop operations
3.971533
4
hail/python/hail/plot/__init__.py
atgenomix/hail
1
6627312
from .plots import output_notebook, show, histogram, cumulative_histogram, histogram2d, scatter, qq, manhattan __all__ = ['output_notebook', 'show', 'histogram', 'cumulative_histogram', 'scatter', 'histogram2d', 'qq', 'manhattan']
from .plots import output_notebook, show, histogram, cumulative_histogram, histogram2d, scatter, qq, manhattan __all__ = ['output_notebook', 'show', 'histogram', 'cumulative_histogram', 'scatter', 'histogram2d', 'qq', 'manhattan']
none
1
1.275322
1
data/studio21_generated/interview/0300/starter_code.py
vijaykumawat256/Prompt-Summarization
0
6627313
class Solution: def leastOpsExpressTarget(self, x: int, target: int) -> int:
class Solution: def leastOpsExpressTarget(self, x: int, target: int) -> int:
none
1
1.83518
2
tutorialScripts/tutorialClientSystem.py
wode490390/Mod-stub
0
6627314
<gh_stars>0 # -*- coding: utf-8 -*- # 获取客户端引擎API模块 import client.extraClientApi as clientApi # 获取客户端system的基类ClientSystem ClientSystem = clientApi.GetClientSystemCls() # 在modMain中注册的Client System类 class TutorialClientSystem(ClientSystem): # 客户端System的初始化函数 def __init__(self, namespace, systemName): #...
# -*- coding: utf-8 -*- # 获取客户端引擎API模块 import client.extraClientApi as clientApi # 获取客户端system的基类ClientSystem ClientSystem = clientApi.GetClientSystemCls() # 在modMain中注册的Client System类 class TutorialClientSystem(ClientSystem): # 客户端System的初始化函数 def __init__(self, namespace, systemName): # 首先初始化Tutori...
zh
0.777592
# -*- coding: utf-8 -*- # 获取客户端引擎API模块 # 获取客户端system的基类ClientSystem # 在modMain中注册的Client System类 # 客户端System的初始化函数 # 首先初始化TutorialClientSystem的基类ClientSystem # 函数名为Destroy才会被调用,在这个System被引擎回收的时候会调这个函数来销毁一些内容
2.524067
3
metrics/outputformat_csv.py
mcallaghan-bsm/metrics
8
6627315
# -*- coding: utf-8 -*- """output in CSV format. All rights reserved, see LICENSE for details. """ from __future__ import unicode_literals def format(file_metrics, build_metrics): """Compute output in CSV format (only file_metrics).""" # TODO maybe we need different output for build_metrics in csv format...
# -*- coding: utf-8 -*- """output in CSV format. All rights reserved, see LICENSE for details. """ from __future__ import unicode_literals def format(file_metrics, build_metrics): """Compute output in CSV format (only file_metrics).""" # TODO maybe we need different output for build_metrics in csv format...
en
0.787076
# -*- coding: utf-8 -*- output in CSV format. All rights reserved, see LICENSE for details. Compute output in CSV format (only file_metrics). # TODO maybe we need different output for build_metrics in csv format, too? # filter out positions metric
3.12233
3
train_encoder.py
Harsha-Musunuri/stylegan2-pytorch
7
6627316
<gh_stars>1-10 import argparse import math import random import os import numpy as np import torch from torch import nn, autograd, optim from torch.nn import functional as F from torch.utils import data import torch.distributed as dist from torchvision import datasets, transforms, utils from PIL import Ima...
import argparse import math import random import os import numpy as np import torch from torch import nn, autograd, optim from torch.nn import functional as F from torch.utils import data import torch.distributed as dist from torchvision import datasets, transforms, utils from PIL import Image from tqdm i...
en
0.478766
# Endless image iterator # accum = 0.5 ** (32 / (10 * 1000)) # sample_x = accumulate_batches(loader, args.n_sample).to(device) # Encode in z space? # always False # Generator should be ema and in eval mode # if args.no_ema or e_ema is None: # e_ema = encoder # Train Encoder # e_regularize = args.e_reg_every > 0 and...
1.979821
2
examples/py/async-instantiate-all-at-once.py
Dan-krm/ccxt
3
6627317
# -*- coding: utf-8 -*- import os import sys import asyncio root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt.async_support as ccxt # noqa: E402 exchanges = {} # a placeholder for your instances async def main(): for id in ccxt....
# -*- coding: utf-8 -*- import os import sys import asyncio root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt.async_support as ccxt # noqa: E402 exchanges = {} # a placeholder for your instances async def main(): for id in ccxt....
en
0.670171
# -*- coding: utf-8 -*- # noqa: E402 # a placeholder for your instances # now exchanges dictionary contains all exchange instances... # close the aiohttp session object
2.709159
3
inheritence_of_class).py
Annonymous-error/general-codes
1
6627318
class phone: #base class def __initt__(self, brand,model ,price): self.brand = brand self.model = model self.price=max(price,0) #sso as to reject non negative values def full_name(self): #class fuction return f"{self.brand}{self...
class phone: #base class def __initt__(self, brand,model ,price): self.brand = brand self.model = model self.price=max(price,0) #sso as to reject non negative values def full_name(self): #class fuction return f"{self.brand}{self...
en
0.821529
#base class #sso as to reject non negative values #class fuction #class fuction # carries all properties of phone #class fuction # carries all properties of phone #python searches methods from child to parent = Method resolution order # print(help(flagshipphone())) # to check given class is subclass ie smartphone is ...
3.798259
4
code/super_minitaur/script/lpmslib/LpmsB.py
buenos-dan/quadrupedal_robot
5
6627319
<gh_stars>1-10 import time import serial import threading import struct import sys from datetime import datetime, timedelta from LpmsConfig import * from lputils import * from LpmsConfigurationSettings import LpmsConfigurationSettings #TODO: # check serial port opened before executing commands # add wait for ack routi...
import time import serial import threading import struct import sys from datetime import datetime, timedelta from LpmsConfig import * from lputils import * from LpmsConfigurationSettings import LpmsConfigurationSettings #TODO: # check serial port opened before executing commands # add wait for ack routine class LpmsB...
en
0.525622
#TODO: # check serial port opened before executing commands # add wait for ack routine # debug log Method that runs forever #print reading # TODO: add offset length check dataList is a list dataList is a list dataList is a list return bytesarray return bytesarray # Parser #print"{0:b}".format(self.config_register) # ad...
2.591282
3
entities/player.py
emredesu/re-one
0
6627320
<filename>entities/player.py import pygame from tools.colours import WHITE, RED from tools.globals import SCREEN_HEIGHT, SCREEN_WIDTH class Player(pygame.sprite.Sprite): def __init__(self, image): super().__init__() self.image = image self.rect = self.image.get_rect() self.rect.x = int(SCREEN...
<filename>entities/player.py import pygame from tools.colours import WHITE, RED from tools.globals import SCREEN_HEIGHT, SCREEN_WIDTH class Player(pygame.sprite.Sprite): def __init__(self, image): super().__init__() self.image = image self.rect = self.image.get_rect() self.rect.x = int(SCREEN...
none
1
2.951992
3
tests/adapters/maze_xml_test.py
the-hypermedia-project/representor-python
11
6627321
<reponame>the-hypermedia-project/representor-python import xml.etree.ElementTree as ET import unittest import json from representor import Representor from representor.contrib.maze_xml import MazeXMLAdapter cell_xml = """<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <maze version="1.0"> <cell> ...
import xml.etree.ElementTree as ET import unittest import json from representor import Representor from representor.contrib.maze_xml import MazeXMLAdapter cell_xml = """<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <maze version="1.0"> <cell> <link href="http://amundsen.com/examples/mazes/2d/fi...
en
0.360688
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <maze version="1.0"> <cell> <link href="http://amundsen.com/examples/mazes/2d/five-by-five/0:north" rel="current" debug="0:1,1,1,0" total="25" side="5" /> <link href="http://amundsen.com/examples/mazes/2d/five-by-five/5:east" rel="east" /> ...
2.771275
3
ryu/app/wsgi.py
SYBreloom/ryu
975
6627322
<reponame>SYBreloom/ryu # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2012 <NAME> <yamahata at private email ne jp> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Lic...
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2012 <NAME> <yamahata at private email ne jp> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
en
0.795413
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2012 <NAME> <yamahata at private email ne jp> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
1.863909
2
terra_bonobo_nodes/terra.py
Terralego/terra-bonobo-nodes
1
6627323
<filename>terra_bonobo_nodes/terra.py import logging from copy import deepcopy from json import JSONDecodeError from bonobo.config import Configurable, Option, Service from bonobo.config.processors import ContextProcessor from bonobo.constants import END, NOT_MODIFIED from bonobo.util.objects import ValueHolder from d...
<filename>terra_bonobo_nodes/terra.py import logging from copy import deepcopy from json import JSONDecodeError from bonobo.config import Configurable, Option, Service from bonobo.config.processors import ContextProcessor from bonobo.constants import END, NOT_MODIFIED from bonobo.util.objects import ValueHolder from d...
en
0.740232
# noqa Extract cluster from layers Options: `input_layers` list of input layers `metric_projection_srid` used projection `distance` minimal distance between each cluster Return: Point cluster point object QuerySet QuerySet of all features included in the cluster SELECT ...
1.939047
2
blogweb/apis/booksapi.py
mnpiozhang/MyBlog
0
6627324
#!/usr/bin/env python #_*_ coding:utf-8 _*_ from django.http import HttpResponse from blogweb.popularbooks.getinfo import get_JD_Top from blogweb.popularbooks import config as cfg from django.views.generic import View import json from collections import OrderedDict class jdBooksApi(View): ''' https...
#!/usr/bin/env python #_*_ coding:utf-8 _*_ from django.http import HttpResponse from blogweb.popularbooks.getinfo import get_JD_Top from blogweb.popularbooks import config as cfg from django.views.generic import View import json from collections import OrderedDict class jdBooksApi(View): ''' https...
en
0.312481
#!/usr/bin/env python #_*_ coding:utf-8 _*_ https://niubidian.top/blog/jdbooks/?item=nbs&category=novel&effectivetime=week&topnumber=23 http://127.0.0.1:8000/blog/jdbooks/?item=nbs&category=novel&effectivetime=week&topnumber=23 返回的TOP数量可以自己定义1--100 item str default 新书销量榜 nbs 新书销量榜 nbs ...
2.334178
2
vilya/models/elastic/issue_pr_search.py
mubashshirjamal/code
1,582
6627325
<reponame>mubashshirjamal/code<gh_stars>1000+ # -*- coding: utf-8 -*- import logging from vilya.libs.store import store from vilya.libs.text import trunc_utf8 from vilya.models.project_issue import ProjectIssue from vilya.models.pull import PullRequest from vilya.models.ticket import Ticket from vilya.models.project...
# -*- coding: utf-8 -*- import logging from vilya.libs.store import store from vilya.libs.text import trunc_utf8 from vilya.models.project_issue import ProjectIssue from vilya.models.pull import PullRequest from vilya.models.ticket import Ticket from vilya.models.project import CodeDoubanProject from vilya.models.us...
en
0.769321
# -*- coding: utf-8 -*-
1.962891
2
evaluate_tests.py
ClaytonNorthey92/hal-ci-example
0
6627326
import re import subprocess import sys if __name__ == '__main__': try: # run the actual tests, this assumes the tests will run in less than 5 seconds. # as the number of tests grows, the timeout will need to be increased # this is done this way because the tests run in a VM, so they are har...
import re import subprocess import sys if __name__ == '__main__': try: # run the actual tests, this assumes the tests will run in less than 5 seconds. # as the number of tests grows, the timeout will need to be increased # this is done this way because the tests run in a VM, so they are har...
en
0.932886
# run the actual tests, this assumes the tests will run in less than 5 seconds. # as the number of tests grows, the timeout will need to be increased # this is done this way because the tests run in a VM, so they are hard to get the # exit code from, so we timeout and read the logs to find the results # we are expectin...
2.559559
3
examples/green-boxes.py
syreal17/ARENA-py
0
6627327
from arena import * import random import time import sys arena = Scene(host="arena.andrew.cmu.edu", realm="realm", scene="example") color = (0, 255, 0) # more complex case: Create many boxes x = 1 @arena.run_forever(interval_ms=500) def make_boxs(): global x # Create a bunch of green boxes drawn directly ...
from arena import * import random import time import sys arena = Scene(host="arena.andrew.cmu.edu", realm="realm", scene="example") color = (0, 255, 0) # more complex case: Create many boxes x = 1 @arena.run_forever(interval_ms=500) def make_boxs(): global x # Create a bunch of green boxes drawn directly ...
en
0.820049
# more complex case: Create many boxes # Create a bunch of green boxes drawn directly to screen
2.715261
3
openpyexcel/pivot/tests/test_record.py
sciris/openpyexcel
2
6627328
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyexcel import pytest from io import BytesIO from zipfile import ZipFile from openpyexcel.packaging.manifest import Manifest from openpyexcel.xml.functions import fromstring, tostring from openpyexcel.tests.helper import compare_xml from .test_fie...
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyexcel import pytest from io import BytesIO from zipfile import ZipFile from openpyexcel.packaging.manifest import Manifest from openpyexcel.xml.functions import fromstring, tostring from openpyexcel.tests.helper import compare_xml from .test_fie...
en
0.120074
# Copyright (c) 2010-2019 openpyexcel <r> <n v="1"/> <n v="25"/> <s v="2014-03-24"/> <x v="0"/> <x v="0"/> <x v="0"/> </r> <r> <n v="1"/> <x v="0"/> <s v="2014-03-24"/> <x v="0"/> <n v="25"/> ...
2.278285
2
ara/sanitizer.py
sparcs-kaist/new-ara-api
19
6627329
from urllib.parse import urlparse import bleach def sanitize(content): def _allowed_attributes(tag, name, value): if name in ['src']: p = urlparse(value) return (not p.netloc) or p.netloc.endswith(('sparcs.org', 'kaist.ac.kr', ...
from urllib.parse import urlparse import bleach def sanitize(content): def _allowed_attributes(tag, name, value): if name in ['src']: p = urlparse(value) return (not p.netloc) or p.netloc.endswith(('sparcs.org', 'kaist.ac.kr', ...
none
1
2.683251
3
openrec/modules/interactions/rnn_softmax.py
csmithchicago/openrec
0
6627330
import tensorflow as tf def RNNSoftmax( seq_item_vec, total_items, seq_len, num_units, cell_type="gru", softmax_samples=None, label=None, train=True, subgraph=None, scope=None, ): with tf.variable_scope(scope, default_name="RNNSoftmax", reuse=tf.AUTO_REUSE): if cel...
import tensorflow as tf def RNNSoftmax( seq_item_vec, total_items, seq_len, num_units, cell_type="gru", softmax_samples=None, label=None, train=True, subgraph=None, scope=None, ): with tf.variable_scope(scope, default_name="RNNSoftmax", reuse=tf.AUTO_REUSE): if cel...
none
1
2.289208
2
feed/serializers.py
ThusharaX/mumbleapi
187
6627331
from rest_framework import serializers from django.contrib.auth.models import User from .models import Mumble from users.serializers import UserProfileSerializer, UserSerializer class MumbleSerializer(serializers.ModelSerializer): user = serializers.SerializerMethodField(read_only=True) original_mumble = ser...
from rest_framework import serializers from django.contrib.auth.models import User from .models import Mumble from users.serializers import UserProfileSerializer, UserSerializer class MumbleSerializer(serializers.ModelSerializer): user = serializers.SerializerMethodField(read_only=True) original_mumble = ser...
en
0.92259
# Returns list of users that upvoted post # Returns list of users that upvoted post
2.116683
2
pandas/tests/extension/base/ops.py
ingwinlu/pandas
1
6627332
import pytest import operator import pandas as pd from pandas.core import ops from .base import BaseExtensionTests class BaseOpsUtil(BaseExtensionTests): def get_op_from_name(self, op_name): short_opname = op_name.strip('_') try: op = getattr(operator, short_opname) except A...
import pytest import operator import pandas as pd from pandas.core import ops from .base import BaseExtensionTests class BaseOpsUtil(BaseExtensionTests): def get_op_from_name(self, op_name): short_opname = op_name.strip('_') try: op = getattr(operator, short_opname) except A...
en
0.77374
# Assume it is the reverse operator # divmod has multiple return values, so check separatly Various Series and DataFrame arithmetic ops methods. Subclasses supporting various ops should set the class variables to indicate that they support ops of that kind * series_scalar_exc = TypeError * frame_scala...
2.690416
3
battle/battle_functions.py
EfrainRG/objectpokemon
1
6627333
import importlib.util import random # from importlib.machinery import SourceFileLoader def load_pokemon_from_file(filepath): spec = importlib.util.spec_from_file_location("", filepath) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) # return SourceFileLoader("", filepath...
import importlib.util import random # from importlib.machinery import SourceFileLoader def load_pokemon_from_file(filepath): spec = importlib.util.spec_from_file_location("", filepath) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) # return SourceFileLoader("", filepath...
en
0.31695
# from importlib.machinery import SourceFileLoader # return SourceFileLoader("", filepath).load_module() # Choose a random pokemon to start
3.302449
3
examples/demo.py
orest-d/liquer-reports
0
6627334
<reponame>orest-d/liquer-reports import sys sys.path.append("..") import matplotlib.pyplot as plt from lqreports.segments import * if __name__ == '__main__': r = Register() doc = ( VuetifyDashboard(r) .with_navigation_drawer() .with_app_bar(color="primary") .with_plotly() ...
import sys sys.path.append("..") import matplotlib.pyplot as plt from lqreports.segments import * if __name__ == '__main__': r = Register() doc = ( VuetifyDashboard(r) .with_navigation_drawer() .with_app_bar(color="primary") .with_plotly() .with_panels() ) r.hom...
en
0.167958
<plotly-chart :chart="chart1" style="min-height:800px;"></plotly-chart> function(){ this.chart2.traces[0].x=[1,2,3,4]; this.chart2.traces[0].y=[10,2,30,4]; } # doc.with_dataframe(pd.DataFrame(dict(a=[1,2,3],b=[4,5,6]))) #r.vuetify_script.add_data("myfilter",False) function(){ console.log(...
2.228455
2
test/test_config_preparation.py
rinrinne/aws-adfs
0
6627335
import mock from aws_adfs import prepare class TestConfigPreparation: def test_when_there_is_no_profile_use_default_values(self): # given profile to read the configuration doesn't exist not_existing_profile = 'not_existing_profile' prepare.configparser = mock.Mock() config_withou...
import mock from aws_adfs import prepare class TestConfigPreparation: def test_when_there_is_no_profile_use_default_values(self): # given profile to read the configuration doesn't exist not_existing_profile = 'not_existing_profile' prepare.configparser = mock.Mock() config_withou...
en
0.864178
# given profile to read the configuration doesn't exist # and defaults are setup as follows # when configuration is prepared for not existing profile # then resolved config contains defaults values # given profile to read the configuration exists # and no options are stored in the profile # and defaults are setup as fo...
2.582475
3
helpers/discretization.py
maryprimary/frg
0
6627336
<reponame>maryprimary/frg """布里渊区中patches相关的功能""" from matplotlib import pyplot import matplotlib.patches as patches import matplotlib.path as path def patches_visualize(pats, lsurface, show): '''可视化patches对应的点和费米面 ''' pyplot.figure() #绘制patches对应的点 xvals = [] yvals = [] for pnt in pats: ...
"""布里渊区中patches相关的功能""" from matplotlib import pyplot import matplotlib.patches as patches import matplotlib.path as path def patches_visualize(pats, lsurface, show): '''可视化patches对应的点和费米面 ''' pyplot.figure() #绘制patches对应的点 xvals = [] yvals = [] for pnt in pats: xvals.append(pnt.c...
zh
0.910823
布里渊区中patches相关的功能 可视化patches对应的点和费米面 #绘制patches对应的点 #绘制费米面的线 可视化切分的效果\n ltris是切分的小三角,lpathces是每个小三角对应的编号\n show = 'window': 显示在窗口\n 其他: 保存为这个名字的图片 ### 得到patch之间的边界 保存patches,lpatches应该是对应好Rtriangles的顺序的\n ```没有直接把pidx放到Rtriabgles的attr里面,这个顺序要对应好``` #第一行记录长度 读取patches,注意对应好保存时候的顺序
2.802918
3
settings.py
Reathe/Qubic
0
6627337
<filename>settings.py window.fullscreen = False window.borderless = False window.exit_button.enabled = False
<filename>settings.py window.fullscreen = False window.borderless = False window.exit_button.enabled = False
none
1
1.094182
1
nodes/1.x/python/String.ReplaceRegularExpression.py
andydandy74/ClockworkForDynamo
147
6627338
<reponame>andydandy74/ClockworkForDynamo<filename>nodes/1.x/python/String.ReplaceRegularExpression.py<gh_stars>100-1000 import clr import re if isinstance(IN[1], list): OUT = [IN[0].sub(IN[2],x) for x in IN[1]] else: OUT = IN[0].sub(IN[2],IN[1])
import clr import re if isinstance(IN[1], list): OUT = [IN[0].sub(IN[2],x) for x in IN[1]] else: OUT = IN[0].sub(IN[2],IN[1])
none
1
2.749288
3
trade_automation/td/td.py
cowen314/web-tools
0
6627339
<reponame>cowen314/web-tools<gh_stars>0 from urllib.parse import urlencode, unquote, parse_qs import json from pathlib import Path import requests from sys import exit import websockets import asyncio import datetime from typing import Dict ### AUTH # See docs here for initial setup: https://developer.tdameritrade.co...
from urllib.parse import urlencode, unquote, parse_qs import json from pathlib import Path import requests from sys import exit import websockets import asyncio import datetime from typing import Dict ### AUTH # See docs here for initial setup: https://developer.tdameritrade.com/content/simple-auth-local-apps # This ...
en
0.580416
### AUTH # See docs here for initial setup: https://developer.tdameritrade.com/content/simple-auth-local-apps # This lib handles all of this (pretty much) automatically: https://github.com/areed1192/td-ameritrade-python-api # Step 1: Create a TD Ameritrade app # Step 2: Hit auth endpoint # print(urlencode({"redirect_ur...
2.635862
3
fabfile.py
pyeliteman/PDF-OCR-RTP
1
6627340
<reponame>pyeliteman/PDF-OCR-RTP<filename>fabfile.py # -*- coding: utf-8 -*- """ Fabfile for managing a Python/Flask/Apache/MySQL project in MacOS/Ubuntu. """ import os from fabric.api import env, task, run, local, get, sudo from fabric.context_managers import cd, lcd, prefix, shell_env PROJECT_NAME = "fbone" # Rem...
# -*- coding: utf-8 -*- """ Fabfile for managing a Python/Flask/Apache/MySQL project in MacOS/Ubuntu. """ import os from fabric.api import env, task, run, local, get, sudo from fabric.context_managers import cd, lcd, prefix, shell_env PROJECT_NAME = "fbone" # Remote Database Config REMOTE_DB_USERNAME = "" REMOTE_DB...
en
0.730428
# -*- coding: utf-8 -*- Fabfile for managing a Python/Flask/Apache/MySQL project in MacOS/Ubuntu. # Remote Database Config # Local Database Config # the user to use for the remote commands # the servers where the commands are executed # http://stackoverflow.com/questions/17102968/reading-logs-with-fabric Setup Python i...
2.127478
2
asynctest.py
projecthexa/hexa
7
6627341
<reponame>projecthexa/hexa import asyncio import datetime def match(pattern): print('Looking for ' + pattern) try: while True: s = (yield) if pattern in s: print(s) except GeneratorExit: print("=== Done ===") m = match("panni") m.__next__()
import asyncio import datetime def match(pattern): print('Looking for ' + pattern) try: while True: s = (yield) if pattern in s: print(s) except GeneratorExit: print("=== Done ===") m = match("panni") m.__next__()
none
1
3.126839
3
dask_test.py
CLAHRCWessex/fast-py-bootstrap
0
6627342
<gh_stars>0 import numpy as np from dask import delayed def bootstrap_dask(data, boots): """ Create bootstrap datasets that represent the distribution of the mean. Returns a numpy array containing the bootstrap datasets Keyword arguments: data -- numpy array of systems to boostrap boots -...
import numpy as np from dask import delayed def bootstrap_dask(data, boots): """ Create bootstrap datasets that represent the distribution of the mean. Returns a numpy array containing the bootstrap datasets Keyword arguments: data -- numpy array of systems to boostrap boots -- number of ...
en
0.551918
Create bootstrap datasets that represent the distribution of the mean. Returns a numpy array containing the bootstrap datasets Keyword arguments: data -- numpy array of systems to boostrap boots -- number of bootstrap (default = 1000) DOESN't Work. Had to switch from numpy array to list ...
3.313833
3
lapy/TetIO.py
AhmedFaisal95/LaPy
8
6627343
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Original Author: <NAME> # Date: Jul-5-2018 # import numpy as np import os.path from .TetMesh import TetMesh def import_gmsh(infile): """ Load GMSH tetrahedron mesh """ extension = os.path.splitext(infile)[1] verbose = 1 if verbose > 0: ...
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Original Author: <NAME> # Date: Jul-5-2018 # import numpy as np import os.path from .TetMesh import TetMesh def import_gmsh(infile): """ Load GMSH tetrahedron mesh """ extension = os.path.splitext(infile)[1] verbose = 1 if verbose > 0: ...
en
0.714293
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Original Author: <NAME> # Date: Jul-5-2018 # Load GMSH tetrahedron mesh # read (nodes X 4) matrix as chunck # drop first column # read (nodes X ?) matrix Load VTK tetrahedron mesh # skip comments # search for ASCII keyword in first 5 lines: # print line # expect Datas...
2.709689
3
model-optimizer/mo/front/mxnet/extractors/pooling.py
mypopydev/dldt
3
6627344
""" Copyright (c) 2018 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
""" Copyright (c) 2018 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
en
0.858093
Copyright (c) 2018 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,...
1.761661
2
zerver/migrations/0238_usermessage_bigint_id.py
kaustubh-nair/zulip
6
6627345
<filename>zerver/migrations/0238_usermessage_bigint_id.py # Generated by Django 1.11.23 on 2019-08-22 22:02 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0237_rename_zulip_realm_to_zulipinternal'), ] operations = [ migration...
<filename>zerver/migrations/0238_usermessage_bigint_id.py # Generated by Django 1.11.23 on 2019-08-22 22:02 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0237_rename_zulip_realm_to_zulipinternal'), ] operations = [ migration...
en
0.596568
# Generated by Django 1.11.23 on 2019-08-22 22:02
1.466214
1
031_CoinSums.py
joetache4/project-euler
0
6627346
""" In the United Kingdom the currency is made up of pound (£) and pence (p). There are eight coins in general circulation: 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p), and £2 (200p). It is possible to make £2 in the following way: 1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p How many different ways can £2 be made us...
""" In the United Kingdom the currency is made up of pound (£) and pence (p). There are eight coins in general circulation: 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p), and £2 (200p). It is possible to make £2 in the following way: 1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p How many different ways can £2 be made us...
en
0.914299
In the United Kingdom the currency is made up of pound (£) and pence (p). There are eight coins in general circulation: 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p), and £2 (200p). It is possible to make £2 in the following way: 1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p How many different ways can £2 be made using ...
3.230886
3
sitioWeb/SucursalA/models.py
UnopposedQuill/muedatos2
0
6627347
from django.db import models ## SucursalA class SACliente(models.Model): idcliente = models.AutoField(db_column='idCliente', primary_key=True) # Field name made lowercase. nombre = models.CharField(max_length=30) apellidos = models.CharField(max_length=30) ubicacionLat = models.FloatField() # This fi...
from django.db import models ## SucursalA class SACliente(models.Model): idcliente = models.AutoField(db_column='idCliente', primary_key=True) # Field name made lowercase. nombre = models.CharField(max_length=30) apellidos = models.CharField(max_length=30) ubicacionLat = models.FloatField() # This fi...
en
0.886408
## SucursalA # Field name made lowercase. # This field type is a guess. # This field type is a guess. # Field name made lowercase. # Field name made lowercase. # Field name made lowercase. # Field name made lowercase. # Field name made lowercase. # Field name made lowercase. # Field name made lowercase. # Field name ma...
2.021249
2
ckanext/datastore/tests/test_unit.py
robin-NEC/ckan
2,805
6627348
<filename>ckanext/datastore/tests/test_unit.py # encoding: utf-8 import ckanext.datastore.backend.postgres as backend import ckanext.datastore.backend.postgres as db import ckanext.datastore.helpers as helpers from ckan.common import config postgres_backend = backend.DatastorePostgresqlBackend() postgres_backend.con...
<filename>ckanext/datastore/tests/test_unit.py # encoding: utf-8 import ckanext.datastore.backend.postgres as backend import ckanext.datastore.backend.postgres as db import ckanext.datastore.helpers as helpers from ckan.common import config postgres_backend = backend.DatastorePostgresqlBackend() postgres_backend.con...
en
0.83829
# encoding: utf-8
2.178244
2
flight/lorikeet/cluster.py
rhysnewell/flock
0
6627349
<filename>flight/lorikeet/cluster.py #!/usr/bin/env python ############################################################################### # cluster.py - A program which handles the UMAP and HDBSCAN python components # of lorikeet ############################################################################...
<filename>flight/lorikeet/cluster.py #!/usr/bin/env python ############################################################################### # cluster.py - A program which handles the UMAP and HDBSCAN python components # of lorikeet ############################################################################...
en
0.438786
#!/usr/bin/env python ############################################################################### # cluster.py - A program which handles the UMAP and HDBSCAN python components # of lorikeet ############################################################################### # ...
1.613081
2
caffe-sparse-tool.py
eric612/caffe-int8-convert-tools
9
6627350
# -*- coding: utf-8 -*- # SenseNets is pleased to support the open source community by making caffe-sparse-tool available. # # Copyright (C) 2018 SenseNets Technology Ltd. All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); you may not use this file except # in compliance with the License...
# -*- coding: utf-8 -*- # SenseNets is pleased to support the open source community by making caffe-sparse-tool available. # # Copyright (C) 2018 SenseNets Technology Ltd. All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); you may not use this file except # in compliance with the License...
en
0.692087
# -*- coding: utf-8 -*- # SenseNets is pleased to support the open source community by making caffe-sparse-tool available. # # Copyright (C) 2018 SenseNets Technology Ltd. All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); you may not use this file except # in compliance with the License....
1.603986
2