hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7eae47a70c095bfbc1d8c21588260d9a469e5a73 | 1,248 | py | Python | cajas/units/models/units.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/units/models/units.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/units/models/units.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null |
from django.contrib.auth import get_user_model
from django.db import models
from cajas.users.models.partner import Partner
User = get_user_model()
class Unit(models.Model):
"""
"""
name = models.CharField(
'Nombre',
max_length=255,
)
partner = models.ForeignKey(
Partner,... | 23.111111 | 48 | 0.612981 |
from django.contrib.auth import get_user_model
from django.db import models
from cajas.users.models.partner import Partner
User = get_user_model()
class Unit(models.Model):
"""
"""
name = models.CharField(
'Nombre',
max_length=255,
)
partner = models.ForeignKey(
Partner,... | 29 | 63 | 54 |
a942e4366baf57f938b3cda60ba6538c8bed4880 | 741 | py | Python | src-django/api/migrations/0009_auto_20160211_2019.py | protocolbuilder/sana.protocol_builder | e84e90202d604617899f0c4e7b34a93755d13171 | [
"BSD-3-Clause"
] | 6 | 2015-06-05T22:41:10.000Z | 2017-09-06T07:08:09.000Z | src-django/api/migrations/0009_auto_20160211_2019.py | protocolbuilder/sana.protocol_builder | e84e90202d604617899f0c4e7b34a93755d13171 | [
"BSD-3-Clause"
] | 406 | 2015-01-11T05:50:07.000Z | 2018-01-05T23:01:04.000Z | src-django/api/migrations/0009_auto_20160211_2019.py | m-socha/sana.protocol_builder | 7b054bbab5ed981bd7bbc357e9657024f3e380e7 | [
"BSD-3-Clause"
] | 9 | 2015-10-12T23:39:31.000Z | 2018-07-11T20:59:32.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
| 25.551724 | 103 | 0.578947 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0008_conditionnode_showif'),
]
operations = [
migrations.RemoveField(
model_name='showif',
na... | 0 | 611 | 23 |
76208aed571d4915b4e60c6b2653494098f4a456 | 3,997 | py | Python | google/appengine/tools/devappserver2/scheduled_executor.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 26 | 2015-01-20T08:02:38.000Z | 2020-06-10T04:57:41.000Z | google/appengine/tools/devappserver2/scheduled_executor.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 53 | 2016-04-06T21:10:43.000Z | 2018-03-19T23:14:33.000Z | google/appengine/tools/devappserver2/scheduled_executor.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 23 | 2016-04-19T05:45:26.000Z | 2021-12-31T23:22:36.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# 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 o... | 29.175182 | 80 | 0.676758 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# 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 o... | 1,863 | 236 | 148 |
63acf1fcd57f6fb6fb63b41fbb02798fdf45d394 | 9,092 | py | Python | ssshare/ss/crawler.py | fredyzhang5532/ShadowSocksShare | 7631c394597beeb1e879c56df9280ad44b4943a7 | [
"Apache-2.0"
] | 1 | 2019-10-02T21:15:31.000Z | 2019-10-02T21:15:31.000Z | ssshare/ss/crawler.py | xili2236/ShadowSocksShare | ae7d969bd866e7cb2f847c1c5bdf1fe5c524a788 | [
"Apache-2.0"
] | null | null | null | ssshare/ss/crawler.py | xili2236/ShadowSocksShare | ae7d969bd866e7cb2f847c1c5bdf1fe5c524a788 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
{
"server": server['server'],
"server_ipv6": "::",
"server_port": int(server['server_port']),
"local_address": "127.0.0.1",
"local_port": 1080,
"password": server['password'],
"timeout": 300,
"udp_timeout": 60,
"method": method,
"... | 33.426471 | 142 | 0.557963 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
{
"server": server['server'],
"server_ipv6": "::",
"server_port": int(server['server_port']),
"local_address": "127.0.0.1",
"local_port": 1080,
"password": server['password'],
"timeout": 300,
"udp_timeout": 60,
"method": method,
"... | 8,142 | 0 | 115 |
08e1c10f3f015c6da77012aac3fc5cb02557876b | 723 | py | Python | api/models.py | jonathankamau/songs-api | d3526089a7e459acfcd9af935e750428d1d5c016 | [
"MIT"
] | null | null | null | api/models.py | jonathankamau/songs-api | d3526089a7e459acfcd9af935e750428d1d5c016 | [
"MIT"
] | null | null | null | api/models.py | jonathankamau/songs-api | d3526089a7e459acfcd9af935e750428d1d5c016 | [
"MIT"
] | null | null | null | """Song Models File."""
from mongoengine import (Document, EmbeddedDocument, EmbeddedDocumentListField,
FloatField, IntField, ObjectIdField, StringField)
class SongRatings(EmbeddedDocument):
"""Song Ratings Model."""
song_id = ObjectIdField(required=True)
rating = IntField(min_v... | 31.434783 | 79 | 0.720609 | """Song Models File."""
from mongoengine import (Document, EmbeddedDocument, EmbeddedDocumentListField,
FloatField, IntField, ObjectIdField, StringField)
class SongRatings(EmbeddedDocument):
"""Song Ratings Model."""
song_id = ObjectIdField(required=True)
rating = IntField(min_v... | 0 | 0 | 0 |
5d5a0af7cce8803e79e7955b3e62e698ddc5ae77 | 1,174 | py | Python | api/webdriver/Controller.py | Cleyton-Oliveira/WhatsAppAPI | c0c12aa7aca9749ca59a176331d42be4d749c7e6 | [
"MIT"
] | null | null | null | api/webdriver/Controller.py | Cleyton-Oliveira/WhatsAppAPI | c0c12aa7aca9749ca59a176331d42be4d749c7e6 | [
"MIT"
] | null | null | null | api/webdriver/Controller.py | Cleyton-Oliveira/WhatsAppAPI | c0c12aa7aca9749ca59a176331d42be4d749c7e6 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
... | 35.575758 | 116 | 0.707836 | from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
cla... | 722 | 0 | 131 |
71a6086dcb34aad387783c96834826e55405de84 | 37 | py | Python | http_server_pkg/app/views/__init__.py | bbcawodu/nav-online-backend | 3085ad686b253ea82478eb2fc365f51dda6d9d96 | [
"MIT"
] | null | null | null | http_server_pkg/app/views/__init__.py | bbcawodu/nav-online-backend | 3085ad686b253ea82478eb2fc365f51dda6d9d96 | [
"MIT"
] | null | null | null | http_server_pkg/app/views/__init__.py | bbcawodu/nav-online-backend | 3085ad686b253ea82478eb2fc365f51dda6d9d96 | [
"MIT"
] | null | null | null | from index import *
from v1 import *
| 12.333333 | 19 | 0.72973 | from index import *
from v1 import *
| 0 | 0 | 0 |
aa7dc3f612394380a2650654747260d99b904fa4 | 1,328 | py | Python | code/numpy/numpy-tutorial-master/scripts/operations.py | vicb1/python-reference | 8bbb5b14ad0781cbb4b16e260ae1dc772acd6063 | [
"MIT"
] | null | null | null | code/numpy/numpy-tutorial-master/scripts/operations.py | vicb1/python-reference | 8bbb5b14ad0781cbb4b16e260ae1dc772acd6063 | [
"MIT"
] | null | null | null | code/numpy/numpy-tutorial-master/scripts/operations.py | vicb1/python-reference | 8bbb5b14ad0781cbb4b16e260ae1dc772acd6063 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
rows,cols = 5, 9
Z1 = np.linspace(0,1,rows*cols).reshape(rows,cols)
show_array(Z1, 'ops-where-before.png')
Z2 = np.where(Z1 > 0.5, 0, 1)
show_array(Z2, 'ops-where-after.png')
Z1 = np.linspace(0,1,rows*cols).reshape(rows,cols)
show_array(Z1, 'ops-maximum-before.png... | 29.511111 | 74 | 0.643825 | import numpy as np
import matplotlib.pyplot as plt
def show_array(Z, name):
Z = np.atleast_2d(Z)
rows,cols = Z.shape
fig = plt.figure(figsize=(cols/4.,rows/4.), dpi=72)
ax = plt.subplot(111)
#plt.imshow(Z, cmap='Purples', extent=[0,cols,0,rows],
# vmin=-.2, vmax=1, interpolation='ne... | 613 | 0 | 23 |
a3d5dfa651af1fbe143d334e1d8c4657393e5e20 | 16,477 | py | Python | demo_examples/v1/pygletprog.py | ohlogic/py3dEngine | 94f920ebd90a35116e04b43fbf6ca29e5c5b5104 | [
"MIT"
] | 2 | 2020-11-21T08:14:17.000Z | 2021-02-28T07:57:40.000Z | demo_examples/v1/pygletprog.py | luntan365/py3dEngine | 94f920ebd90a35116e04b43fbf6ca29e5c5b5104 | [
"MIT"
] | null | null | null | demo_examples/v1/pygletprog.py | luntan365/py3dEngine | 94f920ebd90a35116e04b43fbf6ca29e5c5b5104 | [
"MIT"
] | 1 | 2019-12-11T11:44:01.000Z | 2019-12-11T11:44:01.000Z | #!/usr/bin/python3
import pyglet
from pyglet.gl import *
import sys
import math
import time
import numpy as np
import random
random.seed(7337)
import sys
sys.path.append("./libs")
#sys.path.insert(0, "./db")
#from db import *
from objloader import *
#from objloader_dbload import *
from printfuncs... | 29.79566 | 123 | 0.561328 | #!/usr/bin/python3
import pyglet
from pyglet.gl import *
import sys
import math
import time
import numpy as np
import random
random.seed(7337)
import sys
sys.path.append("./libs")
#sys.path.insert(0, "./db")
#from db import *
from objloader import *
#from objloader_dbload import *
from printfuncs... | 13,843 | 2 | 744 |
d9fe2104368a2ff872293a21be58b2ae2fa87eba | 539 | py | Python | lantz/errors.py | cycomanic/lantz | f2da006a5cf1a232c1576412cd63e565768ab4e1 | [
"BSD-3-Clause"
] | 1 | 2017-11-22T07:16:16.000Z | 2017-11-22T07:16:16.000Z | lantz/errors.py | cycomanic/lantz | f2da006a5cf1a232c1576412cd63e565768ab4e1 | [
"BSD-3-Clause"
] | null | null | null | lantz/errors.py | cycomanic/lantz | f2da006a5cf1a232c1576412cd63e565768ab4e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
lantz.errors
~~~~~~~~~~~~
Implements base classes for instrumentation related exceptions. They are
useful to mix with specific exceptions from libraries or modules and
therefore allowing code to catch them via lantz excepts without
breaking specific ones.
:copyr... | 22.458333 | 76 | 0.705009 | # -*- coding: utf-8 -*-
"""
lantz.errors
~~~~~~~~~~~~
Implements base classes for instrumentation related exceptions. They are
useful to mix with specific exceptions from libraries or modules and
therefore allowing code to catch them via lantz excepts without
breaking specific ones.
:copyr... | 0 | 64 | 69 |
f3a78527df5a65ecf4287d265f3073cf1ab134db | 1,705 | py | Python | tools/Client.py | finishy1995/aws-lib | 3d57d31a57506c02612a7726db1dd56b6821b60d | [
"Apache-2.0"
] | null | null | null | tools/Client.py | finishy1995/aws-lib | 3d57d31a57506c02612a7726db1dd56b6821b60d | [
"Apache-2.0"
] | null | null | null | tools/Client.py | finishy1995/aws-lib | 3d57d31a57506c02612a7726db1dd56b6821b60d | [
"Apache-2.0"
] | null | null | null | import boto3
import botocore
import urllib2
import json
# This method is suitable for IAM role.
# This method is suitable for successful configuration.
# This method is suitable for any other situation.
# Get Client.
# Input: String client type 'profile'|'temporary'
# Output: Null.
| 28.416667 | 88 | 0.687977 | import boto3
import botocore
import urllib2
import json
# This method is suitable for IAM role.
def getTemporaryCertificate(service, region='us-east-1'):
IAMSecurityUrl = 'http://169.254.169.254/latest/meta-data/iam/security-credentials/'
response = urllib2.urlopen(IAMSecurityUrl)
response = urllib2.... | 1,324 | 0 | 88 |
82b22feb3ee2b1d301d63887215750ad31f6a71e | 70 | py | Python | turbogears/feed/__init__.py | timmartin19/turbogears | b5420cb7e55757d418d8fadb512dbd7803c4279c | [
"MIT"
] | null | null | null | turbogears/feed/__init__.py | timmartin19/turbogears | b5420cb7e55757d418d8fadb512dbd7803c4279c | [
"MIT"
] | 9 | 2015-01-27T19:13:56.000Z | 2019-03-29T14:44:31.000Z | turbogears/feed/__init__.py | timmartin19/turbogears | b5420cb7e55757d418d8fadb512dbd7803c4279c | [
"MIT"
] | 13 | 2015-04-14T14:15:53.000Z | 2020-03-18T01:05:46.000Z | from turbogears.feed import feed
FeedController = feed.FeedController
| 23.333333 | 36 | 0.857143 | from turbogears.feed import feed
FeedController = feed.FeedController
| 0 | 0 | 0 |
b2d7b10850e70af0a60426cc4eb71d902b815ec3 | 3,481 | py | Python | test_random.py | ericcao119/Pix2PixFork | 88f1dc1ee1f83a019d6ddc1d835e370917d23e2b | [
"BSD-3-Clause"
] | null | null | null | test_random.py | ericcao119/Pix2PixFork | 88f1dc1ee1f83a019d6ddc1d835e370917d23e2b | [
"BSD-3-Clause"
] | null | null | null | test_random.py | ericcao119/Pix2PixFork | 88f1dc1ee1f83a019d6ddc1d835e370917d23e2b | [
"BSD-3-Clause"
] | null | null | null | """General-purpose test script for image-to-image translation.
Once you have trained your model with train.py, you can use this script to test the model.
It will load a saved model from '--checkpoints_dir' and save the results to '--results_dir'.
It first creates model and dataset given the option. It will hard-code ... | 41.939759 | 116 | 0.72393 | """General-purpose test script for image-to-image translation.
Once you have trained your model with train.py, you can use this script to test the model.
It will load a saved model from '--checkpoints_dir' and save the results to '--results_dir'.
It first creates model and dataset given the option. It will hard-code ... | 434 | 538 | 23 |
5e2917934a1bdba248c915eb37b43ede7a60eb76 | 310 | py | Python | email_splitter.py | itsmeEVIL/ASK_Project | a8689b4f7a367360c0b2f2bf94e7289ad96cb602 | [
"MIT"
] | null | null | null | email_splitter.py | itsmeEVIL/ASK_Project | a8689b4f7a367360c0b2f2bf94e7289ad96cb602 | [
"MIT"
] | null | null | null | email_splitter.py | itsmeEVIL/ASK_Project | a8689b4f7a367360c0b2f2bf94e7289ad96cb602 | [
"MIT"
] | null | null | null | # program to split email to username and domain name
# made by itsmeevil
print("***Email Splitter***")
email = input("\nEnter an email: ")
sliced = email.split("@") # split string at "@" which will put it in an array- ["username", "domain name"]
print(f"\nUsername: {sliced[0]}\nDomain name: {sliced[1]}")
| 28.181818 | 106 | 0.670968 | # program to split email to username and domain name
# made by itsmeevil
print("***Email Splitter***")
email = input("\nEnter an email: ")
sliced = email.split("@") # split string at "@" which will put it in an array- ["username", "domain name"]
print(f"\nUsername: {sliced[0]}\nDomain name: {sliced[1]}")
| 0 | 0 | 0 |
afa24568f517e1cf20c3644846865cb7575e9ddb | 4,896 | py | Python | tests/core/v5_1/alexandria/test_radius_tracker.py | gsalgado/ddht | 341e84e9163338556cd48dd2fcfda9eedec3eb45 | [
"MIT"
] | 1 | 2021-04-05T00:30:39.000Z | 2021-04-05T00:30:39.000Z | tests/core/v5_1/alexandria/test_radius_tracker.py | gsalgado/ddht | 341e84e9163338556cd48dd2fcfda9eedec3eb45 | [
"MIT"
] | null | null | null | tests/core/v5_1/alexandria/test_radius_tracker.py | gsalgado/ddht | 341e84e9163338556cd48dd2fcfda9eedec3eb45 | [
"MIT"
] | null | null | null | from async_service import background_trio_service
import pytest
import trio
from ddht.tools.factories.alexandria import AdvertisementFactory
from ddht.v5_1.alexandria.messages import AdvertiseMessage, PingMessage
from ddht.v5_1.alexandria.radius_tracker import RadiusTracker
@pytest.mark.trio
@pytest.mark.trio
@p... | 33.765517 | 89 | 0.619077 | from async_service import background_trio_service
import pytest
import trio
from ddht.tools.factories.alexandria import AdvertisementFactory
from ddht.v5_1.alexandria.messages import AdvertiseMessage, PingMessage
from ddht.v5_1.alexandria.radius_tracker import RadiusTracker
@pytest.mark.trio
async def test_radius_tr... | 4,452 | 0 | 88 |
9962e07762ece4abf3fefcc3a659bf08988dc1a5 | 1,642 | py | Python | airflow/contrib/operators/bigquery_operator.py | VoiSmart/airflow | c8b67f2ade5a165d46677b59620f782b7e4d1983 | [
"Apache-2.0"
] | 1 | 2021-07-07T17:15:16.000Z | 2021-07-07T17:15:16.000Z | airflow/contrib/operators/bigquery_operator.py | VoiSmart/airflow | c8b67f2ade5a165d46677b59620f782b7e4d1983 | [
"Apache-2.0"
] | 1 | 2020-11-17T18:49:50.000Z | 2020-11-17T18:49:50.000Z | airflow/contrib/operators/bigquery_operator.py | VoiSmart/airflow | c8b67f2ade5a165d46677b59620f782b7e4d1983 | [
"Apache-2.0"
] | 2 | 2015-12-22T15:48:28.000Z | 2016-01-20T22:11:39.000Z | import logging
from airflow.contrib.hooks.bigquery_hook import BigQueryHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class BigQueryOperator(BaseOperator):
"""
Executes BigQuery SQL queries in a specific BigQuery database
"""
template_fields = ('bql',)
templa... | 41.05 | 152 | 0.700365 | import logging
from airflow.contrib.hooks.bigquery_hook import BigQueryHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class BigQueryOperator(BaseOperator):
"""
Executes BigQuery SQL queries in a specific BigQuery database
"""
template_fields = ('bql',)
templa... | 210 | 0 | 27 |
60e8e540c8a8dd1a1e986a50b90f3c57aed2c0af | 656 | py | Python | exp/04_cartpole_ppo.py | GuRongfei/BPG-DBS | 2cd2d1491a4119cf6016ef200868fe4c6d40e88a | [
"MIT"
] | null | null | null | exp/04_cartpole_ppo.py | GuRongfei/BPG-DBS | 2cd2d1491a4119cf6016ef200868fe4c6d40e88a | [
"MIT"
] | null | null | null | exp/04_cartpole_ppo.py | GuRongfei/BPG-DBS | 2cd2d1491a4119cf6016ef200868fe4c6d40e88a | [
"MIT"
] | null | null | null |
import warnings
warnings.filterwarnings("ignore")
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
import gym
from BPG.ppo2 import PPO2
from BPG.ppo_policy import MlpPolicy
env_id = "CartPole-v1"
env = gym.make(env_id)
model = PPO2(MlpPolicy, env, learning_rate=1e-4, verbose=1, tensorboard_log="MLP/", full_tensorb... | 24.296296 | 110 | 0.733232 |
import warnings
warnings.filterwarnings("ignore")
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
import gym
from BPG.ppo2 import PPO2
from BPG.ppo_policy import MlpPolicy
env_id = "CartPole-v1"
env = gym.make(env_id)
model = PPO2(MlpPolicy, env, learning_rate=1e-4, verbose=1, tensorboard_log="MLP/", full_tensorb... | 0 | 0 | 0 |
e00449578db3206a8a1374019b5d3a5015f0e68b | 5,145 | py | Python | ax/core/tests/test_generator_run.py | gbmarc1/Ax | 9428fa64a621cf4562c7e2c63881a0ca2fa2780b | [
"MIT"
] | null | null | null | ax/core/tests/test_generator_run.py | gbmarc1/Ax | 9428fa64a621cf4562c7e2c63881a0ca2fa2780b | [
"MIT"
] | null | null | null | ax/core/tests/test_generator_run.py | gbmarc1/Ax | 9428fa64a621cf4562c7e2c63881a0ca2fa2780b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from ax.core.arm import Arm
from ax.core.generator_run import GeneratorRun
from ax.utils.common.testutils import TestCase
from ax.utils.testing.fake import (
get_arms,
get_model_predictions,
get_model_predictions... | 36.489362 | 88 | 0.641788 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from ax.core.arm import Arm
from ax.core.generator_run import GeneratorRun
from ax.utils.common.testutils import TestCase
from ax.utils.testing.fake import (
get_arms,
get_model_predictions,
get_model_predictions... | 4,353 | 12 | 265 |
811822dcdafe72d6c4d30851e9bfd96b9bd4833a | 198 | py | Python | frontera/logger/handlers/__init__.py | buildfail/frontera | 84f9e1034d2868447db88e865596c0fbb32e70f6 | [
"BSD-3-Clause"
] | 1,267 | 2015-04-15T04:47:12.000Z | 2022-03-29T07:55:15.000Z | frontera/logger/handlers/__init__.py | buildfail/frontera | 84f9e1034d2868447db88e865596c0fbb32e70f6 | [
"BSD-3-Clause"
] | 316 | 2015-04-14T21:28:26.000Z | 2021-05-31T05:31:15.000Z | frontera/logger/handlers/__init__.py | buildfail/frontera | 84f9e1034d2868447db88e865596c0fbb32e70f6 | [
"BSD-3-Clause"
] | 250 | 2015-04-20T07:15:10.000Z | 2022-03-28T15:17:15.000Z | from __future__ import absolute_import
import sys
import logging
from frontera.logger import formatters
CONSOLE = logging.StreamHandler(stream=sys.stdout)
CONSOLE.setFormatter(formatters.CONSOLE)
| 22 | 50 | 0.853535 | from __future__ import absolute_import
import sys
import logging
from frontera.logger import formatters
CONSOLE = logging.StreamHandler(stream=sys.stdout)
CONSOLE.setFormatter(formatters.CONSOLE)
| 0 | 0 | 0 |
4ed8f8f8fb60a3f6d5a0a5f05770e7cf75053b5a | 1,016 | py | Python | Expresiones Regulares I/expresionesRegularesI.py | BrianMarquez3/Python-Course | 2622b4ddfd687505becfd246e82a2ed0cb9b76f3 | [
"MIT"
] | 20 | 2020-08-19T23:27:01.000Z | 2022-02-03T12:02:17.000Z | Expresiones Regulares I/expresionesRegularesI.py | BrianMarquez3/Python-Course | 2622b4ddfd687505becfd246e82a2ed0cb9b76f3 | [
"MIT"
] | 1 | 2021-04-10T18:06:05.000Z | 2021-04-10T18:06:05.000Z | Expresiones Regulares I/expresionesRegularesI.py | BrianMarquez3/Python-Course | 2622b4ddfd687505becfd246e82a2ed0cb9b76f3 | [
"MIT"
] | 2 | 2020-12-03T19:35:36.000Z | 2021-11-10T14:58:39.000Z | # Expresiones Regulares I
# las expresiones reguales son una secuencia de caracteres que forman un patron de busqueda
# Sirven para el trabajo de procesamiento de texto
import re
cadena = "Vamos a aprender expresiones regulares en python. python es un lenguaje de sintaxis sencilla"
#buscarmos las palabre aprender
#... | 30.787879 | 109 | 0.690945 | # Expresiones Regulares I
# las expresiones reguales son una secuencia de caracteres que forman un patron de busqueda
# Sirven para el trabajo de procesamiento de texto
import re
cadena = "Vamos a aprender expresiones regulares en python. python es un lenguaje de sintaxis sencilla"
#buscarmos las palabre aprender
#... | 0 | 0 | 0 |
0eb61d1cc0b130f55e56ac0883ce562413c31b93 | 232 | py | Python | lunzi/nn/__init__.py | LinZichuan/AdMRL | 50a22d4d480e99125cc91cc65dfcc0df4a883ac6 | [
"MIT"
] | 27 | 2020-06-17T11:40:17.000Z | 2021-11-16T07:39:33.000Z | lunzi/nn/__init__.py | LinZichuan/AdMRL | 50a22d4d480e99125cc91cc65dfcc0df4a883ac6 | [
"MIT"
] | 3 | 2020-06-19T07:01:48.000Z | 2020-06-19T07:14:57.000Z | lunzi/nn/__init__.py | LinZichuan/AdMRL | 50a22d4d480e99125cc91cc65dfcc0df4a883ac6 | [
"MIT"
] | 5 | 2020-11-19T01:11:24.000Z | 2021-12-24T09:03:56.000Z | from . import patch
from .parameter import Parameter
from .module import Module
from .container import *
from . import utils
from .utils import make_method
from .layers import *
from .loss import *
from .flat_param import FlatParam
| 23.2 | 33 | 0.793103 | from . import patch
from .parameter import Parameter
from .module import Module
from .container import *
from . import utils
from .utils import make_method
from .layers import *
from .loss import *
from .flat_param import FlatParam
| 0 | 0 | 0 |
76c35af9b556f39237982e896afb9be26b25dc82 | 577 | py | Python | src/day07b.py | MKuranowski/AdventOfCode2021 | 55a1da3e410ff2ccb8a80f9b7ae97e6b1d759195 | [
"WTFPL"
] | null | null | null | src/day07b.py | MKuranowski/AdventOfCode2021 | 55a1da3e410ff2ccb8a80f9b7ae97e6b1d759195 | [
"WTFPL"
] | null | null | null | src/day07b.py | MKuranowski/AdventOfCode2021 | 55a1da3e410ff2ccb8a80f9b7ae97e6b1d759195 | [
"WTFPL"
] | null | null | null | from fileinput import FileInput
from typing import Iterable
import day07a
if __name__ == "__main__":
day07a.calculate_fuel_needed = calculate_fuel_needed
input: "FileInput[str]" = FileInput()
initial_positions = list(map(int, next(input).rstrip().split(",")))
print(day07a.find_cheapest_position(in... | 27.47619 | 84 | 0.736568 | from fileinput import FileInput
from typing import Iterable
import day07a
def single_fuel_needed(delta: int) -> int:
return delta * (delta + 1) // 2
def calculate_fuel_needed(positions: Iterable[int], target: int) -> int:
return sum(single_fuel_needed(abs(target - position)) for position in positions)
if... | 193 | 0 | 46 |
d3fd6584e02eb39c35077c5f1007cc65bb2e4ec5 | 884 | py | Python | tests/test_phe_multiplications.py | fiu-cloud/distribute-compute | 1e99a8bc979c19db359bc9305955fa0bd7e517c9 | [
"Apache-2.0"
] | null | null | null | tests/test_phe_multiplications.py | fiu-cloud/distribute-compute | 1e99a8bc979c19db359bc9305955fa0bd7e517c9 | [
"Apache-2.0"
] | null | null | null | tests/test_phe_multiplications.py | fiu-cloud/distribute-compute | 1e99a8bc979c19db359bc9305955fa0bd7e517c9 | [
"Apache-2.0"
] | null | null | null | import math
import phe.paillier as paillier
pubkey, prikey = paillier.generate_paillier_keypair(n_length=1024)
# TODO: fails when iterations more than 17 (key length 1024) irrational test intermittently fails. Result either incorrect (random) or overflow
iterations = 17
# factorial test
factorial = pubkey.encrypt(1)
... | 31.571429 | 143 | 0.695701 | import math
import phe.paillier as paillier
pubkey, prikey = paillier.generate_paillier_keypair(n_length=1024)
# TODO: fails when iterations more than 17 (key length 1024) irrational test intermittently fails. Result either incorrect (random) or overflow
iterations = 17
# factorial test
factorial = pubkey.encrypt(1)
... | 0 | 0 | 0 |
e7b9e35b244841fc01512a06d2e13ffeba8182d0 | 803 | py | Python | src/download_data.py | michelle-wms/DSCI_522_GROUP3_COFFEERATINGS | 749997837f9ce45407560ea7afef6b2e2394d333 | [
"MIT"
] | null | null | null | src/download_data.py | michelle-wms/DSCI_522_GROUP3_COFFEERATINGS | 749997837f9ce45407560ea7afef6b2e2394d333 | [
"MIT"
] | 13 | 2021-11-18T19:48:03.000Z | 2021-12-07T22:25:28.000Z | src/download_data.py | michelle-wms/DSCI_522_GROUP3_COFFEERATINGS | 749997837f9ce45407560ea7afef6b2e2394d333 | [
"MIT"
] | 4 | 2021-11-18T20:31:56.000Z | 2021-11-19T01:56:41.000Z | # author: Arlin Cherian, Kristin Bunyan, Michelle Wang, Berkay Bulut
# date: 2021-11-18
"""Downloads data csv data from the web to a local filepath as either a csv format
Usage: src/download_data.py --url=<url> --out_file=<out_file>
Options:
--url=<url> URL from where to download the data (must be in sta... | 27.689655 | 93 | 0.683686 | # author: Arlin Cherian, Kristin Bunyan, Michelle Wang, Berkay Bulut
# date: 2021-11-18
"""Downloads data csv data from the web to a local filepath as either a csv format
Usage: src/download_data.py --url=<url> --out_file=<out_file>
Options:
--url=<url> URL from where to download the data (must be in sta... | 202 | 0 | 23 |
b988612dd3fec3892cd8a743e5183275f6551337 | 207 | py | Python | pythonavancado/exercicios/secao04/ex047.py | mrqssjeff/project-python | b3b08f2acfe825640a5ee92cf9d6fa45ab580384 | [
"MIT"
] | null | null | null | pythonavancado/exercicios/secao04/ex047.py | mrqssjeff/project-python | b3b08f2acfe825640a5ee92cf9d6fa45ab580384 | [
"MIT"
] | null | null | null | pythonavancado/exercicios/secao04/ex047.py | mrqssjeff/project-python | b3b08f2acfe825640a5ee92cf9d6fa45ab580384 | [
"MIT"
] | null | null | null | from time import sleep
num = int(input('Digite um número inteiro de 4 digitos: '))
numero = str(num)
print('Os digitos do número informado são: ')
for c in range(0, 4):
sleep(1)
print(numero[c])
| 25.875 | 59 | 0.666667 | from time import sleep
num = int(input('Digite um número inteiro de 4 digitos: '))
numero = str(num)
print('Os digitos do número informado são: ')
for c in range(0, 4):
sleep(1)
print(numero[c])
| 0 | 0 | 0 |
9f381f746e793d8096683aa4bb9667ce25c5ff54 | 1,442 | py | Python | src/ctm_python_client/jobs/file_transfer.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 5 | 2021-12-01T18:40:00.000Z | 2022-03-04T10:51:44.000Z | src/ctm_python_client/jobs/file_transfer.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 3 | 2022-02-21T20:08:32.000Z | 2022-03-16T17:41:03.000Z | src/ctm_python_client/jobs/file_transfer.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 7 | 2021-12-01T11:59:16.000Z | 2022-03-01T18:16:40.000Z | from ctm_python_client.core.base import BaseJob
| 34.333333 | 85 | 0.658807 | from ctm_python_client.core.base import BaseJob
class FileTransferJob(BaseJob):
def __init__(
self,
folder,
job_name,
connection_profile_src,
connection_profile_dest,
number_of_retries,
s3_bucket_name,
file_transfers,
host=None,
run_a... | 1,307 | 10 | 76 |
32008c1c69db2f5a8b41c9581b1685d58f8242bf | 590 | py | Python | ser.py | elhexx/RFID_READER | 3a55f3c2cde5b5cfdd285b180c391e2468dc502b | [
"Apache-2.0"
] | 1 | 2020-04-21T10:08:44.000Z | 2020-04-21T10:08:44.000Z | ser.py | elhexx/RFID_READER | 3a55f3c2cde5b5cfdd285b180c391e2468dc502b | [
"Apache-2.0"
] | null | null | null | ser.py | elhexx/RFID_READER | 3a55f3c2cde5b5cfdd285b180c391e2468dc502b | [
"Apache-2.0"
] | null | null | null | from serial import Serial
from time import sleep
from datetime import datetime
import requests
URL = 'http://127.0.0.1:8080/postLog'
serial_connection = Serial('/dev/ttyACM0', 9600)
while True:
id = str(serial_connection.readline())
id = id.strip('\n')
state = str(serial_connection.readline())
state... | 21.851852 | 66 | 0.645763 | from serial import Serial
from time import sleep
from datetime import datetime
import requests
URL = 'http://127.0.0.1:8080/postLog'
def post(id, state):
data = {'id': id, 'success': state, 'time': datetime.utcnow()}
req = requests.post(URL, data)
print req.status_code
serial_connection = Serial('/dev/t... | 127 | 0 | 23 |
7f5972c0ed9076423319754c8e79c0cc8ce82802 | 67,604 | py | Python | release/scripts/addons/io_scene_x3d/export_x3d.py | wycivil08/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 30 | 2015-01-29T14:06:05.000Z | 2022-01-10T07:47:29.000Z | release/scripts/addons/io_scene_x3d/export_x3d.py | ttagu99/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 1 | 2017-02-20T20:57:48.000Z | 2018-12-19T23:44:38.000Z | release/scripts/addons/io_scene_x3d/export_x3d.py | ttagu99/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 15 | 2015-04-23T02:38:36.000Z | 2021-03-01T20:09:39.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 44.682089 | 215 | 0.477176 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 61,844 | 0 | 233 |
d71f368ab3f2768e58ce26e5ba78fef3e0e2ac93 | 749 | py | Python | examples/New Functions/Example circle 1.py | karstenw/nodebox-pyobjc | 477aeaa53636944cd400ecdfe97f4ff2480761c7 | [
"MIT"
] | 6 | 2016-05-02T02:25:23.000Z | 2022-03-16T14:01:54.000Z | examples/New Functions/Example circle 1.py | karstenw/nodebox-pyobjc | 477aeaa53636944cd400ecdfe97f4ff2480761c7 | [
"MIT"
] | 2 | 2018-01-27T18:24:20.000Z | 2018-02-10T23:33:46.000Z | examples/New Functions/Example circle 1.py | karstenw/nodebox-pyobjc | 477aeaa53636944cd400ecdfe97f4ff2480761c7 | [
"MIT"
] | 1 | 2018-01-28T15:22:11.000Z | 2018-01-28T15:22:11.000Z |
var("x", NUMBER, default=50, min=10, max=301, handler=params)
var("y", NUMBER, default=50, min=10, max=301, handler=params)
var("r1", NUMBER, default=50, min=10, max=300, handler=params)
var("r2", NUMBER, default=50, min=10, max=300, handler=params)
paintcircle(x,y,r1,r2)
| 24.16129 | 62 | 0.576769 |
def params(val, name):
global x, y,r1,r2
# global scope needs updating.
val = int(round(val,0))
if name == "x":
x = round(val,1)
elif name == "y":
y = round(val,1)
elif name == "r1":
r1 = round(val,1)
elif name == "r2":
r2 = round(val,1)
paintcircle(x,y,... | 426 | 0 | 46 |
b85c1ea821995467e306e15cb4b50497a3709690 | 6,892 | py | Python | cosima_cookbook/querying.py | josuemtzmo/cosima-cookbook | ac26aa60cfc4e8d4a60a5615a81d0563e961be57 | [
"Apache-2.0"
] | null | null | null | cosima_cookbook/querying.py | josuemtzmo/cosima-cookbook | ac26aa60cfc4e8d4a60a5615a81d0563e961be57 | [
"Apache-2.0"
] | null | null | null | cosima_cookbook/querying.py | josuemtzmo/cosima-cookbook | ac26aa60cfc4e8d4a60a5615a81d0563e961be57 | [
"Apache-2.0"
] | null | null | null | """querying.py
Functions for data discovery.
"""
import logging
import os.path
import pandas as pd
from sqlalchemy import func, distinct
import warnings
import xarray as xr
from . import database
from .database import NCExperiment, NCFile, CFVariable, NCVar
def get_experiments(session):
"""
Returns a Data... | 32.205607 | 101 | 0.641904 | """querying.py
Functions for data discovery.
"""
import logging
import os.path
import pandas as pd
from sqlalchemy import func, distinct
import warnings
import xarray as xr
from . import database
from .database import NCExperiment, NCFile, CFVariable, NCVar
class VariableNotFoundError(Exception):
pass
def ge... | 0 | 27 | 23 |
3e2bbdbb5d092b9ddebfd9ceafff1bc4e02fc9da | 670 | py | Python | threading/cat.py | ericxlive/threading | f773bf3dd753ce8a81657641216fc4ca42f34bb0 | [
"MIT"
] | null | null | null | threading/cat.py | ericxlive/threading | f773bf3dd753ce8a81657641216fc4ca42f34bb0 | [
"MIT"
] | null | null | null | threading/cat.py | ericxlive/threading | f773bf3dd753ce8a81657641216fc4ca42f34bb0 | [
"MIT"
] | null | null | null | from threading import Thread
import time
""" The Cat class is a Thread by itself. There must be an __init__ calling Super
__init__ with self as an argument. Also, there must be an "run" def. """
| 39.411765 | 80 | 0.61194 | from threading import Thread
import time
""" The Cat class is a Thread by itself. There must be an __init__ calling Super
__init__ with self as an argument. Also, there must be an "run" def. """
class Cat(Thread): # Cat is a thread.
def run(self): # This is the default thread method.
... | 371 | 27 | 76 |
b27ceeb0056b52b0d9807f33ccb36e00d9ea1e0e | 1,795 | py | Python | reader.py | kant/stream-daemon | 729bc576b74dcd9f1e2021a2433d176d33c413c9 | [
"MIT"
] | 2 | 2016-06-06T22:50:21.000Z | 2018-01-17T16:14:05.000Z | reader.py | kant/stream-daemon | 729bc576b74dcd9f1e2021a2433d176d33c413c9 | [
"MIT"
] | null | null | null | reader.py | kant/stream-daemon | 729bc576b74dcd9f1e2021a2433d176d33c413c9 | [
"MIT"
] | 1 | 2018-08-27T19:57:03.000Z | 2018-08-27T19:57:03.000Z | # IDEA: harvest.py?
import sys
import socket
import simplejson as json
from config import config
dispatch_table = {
"add-project" : add_project,
"stop-project" : stop_project,
"list-projects" : list_projects,
"shutdown" : shutdown,
}
if len(sys.argv) == 1 or sys.argv[1] not in dispatch_table:
p... | 23.311688 | 62 | 0.601671 | # IDEA: harvest.py?
import sys
import socket
import simplejson as json
from config import config
def add_project(data):
return """
Project %(name)s created with ID %(id)s.
""" % data
def stop_project(data):
if "error" in data:
return data["error"]
return """
Project %(name)s ... | 660 | 0 | 92 |
085e22a2e2bb555c01a302f6e38d687290ea209e | 2,845 | py | Python | plot_lib/library/print.py | chia-net-ru/achia-dash | a7a752a9c3712a8823c57a49fbee4f6337381d7d | [
"Apache-2.0"
] | 10 | 2021-05-30T04:42:33.000Z | 2021-06-28T03:29:10.000Z | plot_lib/library/print.py | chia-net-ru/achia-dash | a7a752a9c3712a8823c57a49fbee4f6337381d7d | [
"Apache-2.0"
] | 6 | 2021-05-30T05:48:27.000Z | 2021-06-18T19:04:46.000Z | plot_lib/library/print.py | chia-net-ru/achia-dash | a7a752a9c3712a8823c57a49fbee4f6337381d7d | [
"Apache-2.0"
] | 2 | 2021-06-06T18:12:11.000Z | 2021-06-08T21:21:37.000Z |
from datetime import datetime
| 32.701149 | 125 | 0.635852 |
from datetime import datetime
def get_job_data( running_work):
rows = []
for pid in running_work.keys():
rows.append(_get_row_info(pid, running_work))
rows.sort(key=lambda x: (x[5]), reverse=True)
for i in range(len(rows)):
rows[i] = [str(i+1)] + rows[i]
return rows
def _get_ro... | 2,670 | 0 | 138 |
fcba6776a6dca23606a2064bab5e2a6bcb004b5c | 415 | py | Python | 5program.py | pratikbawkar/abc | b27fe9b356d955d370a95879386472df420e6a21 | [
"Apache-2.0"
] | null | null | null | 5program.py | pratikbawkar/abc | b27fe9b356d955d370a95879386472df420e6a21 | [
"Apache-2.0"
] | null | null | null | 5program.py | pratikbawkar/abc | b27fe9b356d955d370a95879386472df420e6a21 | [
"Apache-2.0"
] | null | null | null | # Python Program to print Strong Numbers from 1 to N
import math
maximum = int(input(" Please Enter the Maximum Value: "))
for Number in range(1, maximum):
Temp = Number
Sum = 0
while(Temp > 0):
Reminder = Temp % 10
Factorial = math.factorial(Reminder)
Sum = Sum + Factorial
... | 25.9375 | 57 | 0.595181 | # Python Program to print Strong Numbers from 1 to N
import math
maximum = int(input(" Please Enter the Maximum Value: "))
for Number in range(1, maximum):
Temp = Number
Sum = 0
while(Temp > 0):
Reminder = Temp % 10
Factorial = math.factorial(Reminder)
Sum = Sum + Factorial
... | 0 | 0 | 0 |
e13458f57c796ad9a7c40942240b88be120c10fb | 1,633 | py | Python | examples/gizmo_sample.py | ousttrue/glglue | 2a54812c2868da668c5931ef7e2209f4cd881c69 | [
"MIT"
] | 7 | 2016-11-11T20:42:30.000Z | 2020-01-26T07:57:59.000Z | examples/gizmo_sample.py | ousttrue/glglue | 2a54812c2868da668c5931ef7e2209f4cd881c69 | [
"MIT"
] | null | null | null | examples/gizmo_sample.py | ousttrue/glglue | 2a54812c2868da668c5931ef7e2209f4cd881c69 | [
"MIT"
] | 1 | 2021-11-25T02:44:56.000Z | 2021-11-25T02:44:56.000Z | #
# pip install pyside6
#
from PySide6 import QtWidgets, QtGui, QtCore
import logging
from glglue.ctypesmath.camera import FrameState
import glglue.gl3.samplecontroller
from glglue.gl3 import gizmo
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(levelname)s:%(name)s:%(message)s',
... | 28.155172 | 77 | 0.659522 | #
# pip install pyside6
#
from PySide6 import QtWidgets, QtGui, QtCore
import logging
from glglue.ctypesmath.camera import FrameState
import glglue.gl3.samplecontroller
from glglue.gl3 import gizmo
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(levelname)s:%(name)s:%(message)s',
... | 941 | 45 | 152 |
f27227412055499e0cdf69a023b660dff7f5095c | 1,662 | py | Python | Scripts/Debug/Hebbian_Simon.py | JeshuaT/PsyNeuLink | 912f691028e848659055430f37b6c15273c762f1 | [
"Apache-2.0"
] | 67 | 2018-01-05T22:18:44.000Z | 2022-03-27T11:27:31.000Z | Scripts/Debug/Hebbian_Simon.py | JeshuaT/PsyNeuLink | 912f691028e848659055430f37b6c15273c762f1 | [
"Apache-2.0"
] | 1,064 | 2017-12-01T18:58:27.000Z | 2022-03-31T22:22:24.000Z | Scripts/Debug/Hebbian_Simon.py | JeshuaT/PsyNeuLink | 912f691028e848659055430f37b6c15273c762f1 | [
"Apache-2.0"
] | 25 | 2017-12-01T20:27:07.000Z | 2022-03-08T21:49:39.000Z | import psyneulink as pnl
import numpy as np
import matplotlib.pyplot as plt
#sample Hebb
FeatureNames=['small','medium','large','red','yellow','blue','circle','rectangle','triangle']
# create a variable that corresponds to the size of our feature space
sizeF = len(FeatureNames)
small_red_circle = [1,0,0,1,0,0,1,0,0]
... | 25.569231 | 93 | 0.723827 | import psyneulink as pnl
import numpy as np
import matplotlib.pyplot as plt
#sample Hebb
FeatureNames=['small','medium','large','red','yellow','blue','circle','rectangle','triangle']
# create a variable that corresponds to the size of our feature space
sizeF = len(FeatureNames)
small_red_circle = [1,0,0,1,0,0,1,0,0]
... | 647 | 0 | 46 |
78f3615d1938c92ed32121156e7a060b048a7b99 | 1,678 | py | Python | 20210421/jeonggyujin/module_endecrypt.py | TEAM-DEFINITION/individual_repository | 9a58a3a26aabfde550332cbf8575814d41a3e94f | [
"Apache-2.0"
] | null | null | null | 20210421/jeonggyujin/module_endecrypt.py | TEAM-DEFINITION/individual_repository | 9a58a3a26aabfde550332cbf8575814d41a3e94f | [
"Apache-2.0"
] | null | null | null | 20210421/jeonggyujin/module_endecrypt.py | TEAM-DEFINITION/individual_repository | 9a58a3a26aabfde550332cbf8575814d41a3e94f | [
"Apache-2.0"
] | null | null | null | import os, hashlib
from cryptography.fernet import Fernet
import base64
#import ast
import json
import module_postcode
import datetime
'''
Encrypt Mode : Fernet
Decrypt Mode : Fernet
Key size : 32bytes
'''
# 키를 사용하기위해 만드는 로직
# 클라이언트에게 보낼 키를 암호화
# 클라이언트에게 받은 키를 복호화
| 28.931034 | 136 | 0.615018 | import os, hashlib
from cryptography.fernet import Fernet
import base64
#import ast
import json
import module_postcode
import datetime
'''
Encrypt Mode : Fernet
Decrypt Mode : Fernet
Key size : 32bytes
'''
class FerCipher:
# 키를 사용하기위해 만드는 로직
def __init__(self, key):
self.key = key
# 키 파싱
... | 1,690 | -5 | 100 |
3b9f53d4a172bb34c0c70935ed9c8a69134cf3f5 | 3,255 | py | Python | cv_class/proj1/code/proj1test.py | MIXALER/python_projects | 57858cc4a4d85c86122b44c2c0afccafc4a052b4 | [
"MIT"
] | 1 | 2021-06-22T09:28:58.000Z | 2021-06-22T09:28:58.000Z | cv_class/proj1/code/proj1test.py | MIXALER/python_projects | 57858cc4a4d85c86122b44c2c0afccafc4a052b4 | [
"MIT"
] | null | null | null | cv_class/proj1/code/proj1test.py | MIXALER/python_projects | 57858cc4a4d85c86122b44c2c0afccafc4a052b4 | [
"MIT"
] | null | null | null | import os
from skimage.transform import rescale
import numpy as np
import matplotlib.pyplot as plt
from cv_class.proj1.code.student import vis_hybrid_image, load_image, save_image, my_imfilter, gen_hybrid_image
resultsDir = '..' + os.sep + 'results'
if not os.path.exists(resultsDir):
os.mkdir(resultsDir)
test_ima... | 39.216867 | 111 | 0.741321 | import os
from skimage.transform import rescale
import numpy as np
import matplotlib.pyplot as plt
from cv_class.proj1.code.student import vis_hybrid_image, load_image, save_image, my_imfilter, gen_hybrid_image
resultsDir = '..' + os.sep + 'results'
if not os.path.exists(resultsDir):
os.mkdir(resultsDir)
test_ima... | 0 | 0 | 0 |
682cad5b5afcd192802a45412cd97229384f4399 | 24,016 | py | Python | sdk/python/feast/offline_store.py | josegpg/feast | 3b6d993793cd938e37053d76697864df1a2f39b6 | [
"Apache-2.0"
] | null | null | null | sdk/python/feast/offline_store.py | josegpg/feast | 3b6d993793cd938e37053d76697864df1a2f39b6 | [
"Apache-2.0"
] | null | null | null | sdk/python/feast/offline_store.py | josegpg/feast | 3b6d993793cd938e37053d76697864df1a2f39b6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Feast Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 40.227806 | 359 | 0.68571 | # Copyright 2019 The Feast Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 9,702 | 587 | 194 |
bd109cf06ba5a492efd72dce191ed841d34d4c76 | 8,959 | py | Python | src/gamesbyexample/reversi.py | RedStarfish/PythonStdioGames | 0fa4d42f1a0c2dde403e70cdd47e7a9e81430efe | [
"MIT"
] | null | null | null | src/gamesbyexample/reversi.py | RedStarfish/PythonStdioGames | 0fa4d42f1a0c2dde403e70cdd47e7a9e81430efe | [
"MIT"
] | null | null | null | src/gamesbyexample/reversi.py | RedStarfish/PythonStdioGames | 0fa4d42f1a0c2dde403e70cdd47e7a9e81430efe | [
"MIT"
] | null | null | null | """Reversi, by Al Sweigart al@inventwithpython.com
A tile flipping game, also called reversi.
More info https://en.wikipedia.org/wiki/Reversi"""
__version__ = 1
# A version of this game is featured in the book, "Invent Your Own
# Computer Games with Python. https://nostarch.com/inventwithpython
import random, sys
C... | 31.996429 | 105 | 0.566023 | """Reversi, by Al Sweigart al@inventwithpython.com
A tile flipping game, also called reversi.
More info https://en.wikipedia.org/wiki/Reversi"""
__version__ = 1
# A version of this game is featured in the book, "Invent Your Own
# Computer Games with Python. https://nostarch.com/inventwithpython
import random, sys
C... | 1,579 | 0 | 46 |
2c5cbb61173976d8a4fca6bb03cc95b4c4f67a1f | 9,681 | py | Python | utils.py | wslc1314/TextSentimentClassification | fbc67289f40cf01a737ac4ff8face7d75777a226 | [
"MIT"
] | 16 | 2018-03-17T07:31:03.000Z | 2022-03-16T08:44:47.000Z | utils.py | wslc1314/TextSentimentClassification | fbc67289f40cf01a737ac4ff8face7d75777a226 | [
"MIT"
] | 2 | 2018-04-17T02:59:19.000Z | 2020-07-22T08:00:17.000Z | utils.py | wslc1314/TextSentimentClassification | fbc67289f40cf01a737ac4ff8face7d75777a226 | [
"MIT"
] | 11 | 2018-04-23T23:14:58.000Z | 2021-07-23T02:20:51.000Z | import pandas as pd
import numpy as np
import os
from configs import general_config
from data_helpers.utils import readNewFile,loadDict
import logging
import tensorflow as tf
"""
将单词列表形式的句子转为句子列表形式的文档,
以"."、"?"、"!"为句子分隔符。
"""
| 39.353659 | 93 | 0.616259 | import pandas as pd
import numpy as np
import os
from configs import general_config
from data_helpers.utils import readNewFile,loadDict
import logging
import tensorflow as tf
def get_num_params():
# for v in tf.trainable_variables():
# print(v.name)
# print(np.prod(v.get_shape().as_list()))
ret... | 9,045 | 46 | 425 |
8db841ec4aad5e9c5189c8fd2b53b69e212eeabc | 2,480 | py | Python | Association Rule Learning/Apriori/Python/online_retail.py | IEEE-APSIT/machinelearning-resources | 35bd1d8f039ba959772e988a56e09df9251276a9 | [
"MIT"
] | 1 | 2020-08-01T06:24:38.000Z | 2020-08-01T06:24:38.000Z | Association Rule Learning/Apriori/Python/online_retail.py | IEEE-APSIT/machinelearning-resources | 35bd1d8f039ba959772e988a56e09df9251276a9 | [
"MIT"
] | null | null | null | Association Rule Learning/Apriori/Python/online_retail.py | IEEE-APSIT/machinelearning-resources | 35bd1d8f039ba959772e988a56e09df9251276a9 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from apyori import apriori
# Loading the Data
data = pd.read_excel('Online_Retail.xlsx')
data.head()
# Exploring the columns of the data
data.columns
# Exploring the different regions of transactions
data.Country.unique()
# Stripping extra spaces in the descriptio... | 25.833333 | 77 | 0.720565 | import numpy as np
import pandas as pd
from apyori import apriori
# Loading the Data
data = pd.read_excel('Online_Retail.xlsx')
data.head()
# Exploring the columns of the data
data.columns
# Exploring the different regions of transactions
data.Country.unique()
# Stripping extra spaces in the descriptio... | 46 | 0 | 22 |
e2d320097bd277d19b2458f5b7dc9c434e6efb1d | 288 | py | Python | prediction/apis/worker_microsoft.py | ecosystemai/ecosystem-notebooks | 7282f22fbe7ab7a43b2b0c06c74b3f176defaca4 | [
"MIT"
] | 2 | 2020-08-30T12:50:47.000Z | 2020-11-24T12:59:43.000Z | prediction/apis/worker_microsoft.py | ecosystemai/ecosystem-notebooks | 7282f22fbe7ab7a43b2b0c06c74b3f176defaca4 | [
"MIT"
] | null | null | null | prediction/apis/worker_microsoft.py | ecosystemai/ecosystem-notebooks | 7282f22fbe7ab7a43b2b0c06c74b3f176defaca4 | [
"MIT"
] | 2 | 2020-09-02T16:54:25.000Z | 2021-06-20T20:30:11.000Z | from prediction.endpoints import worker_microsoft as endpoints
from prediction import request_utils | 26.181818 | 62 | 0.777778 | from prediction.endpoints import worker_microsoft as endpoints
from prediction import request_utils
def get_anomaly(auth, string):
ep = endpoints.GET_ANOMALY
param_dict = {
"string": string
}
resp = request_utils.create(auth, ep, params=param_dict)
meta = resp.json()
return meta | 166 | 0 | 23 |
0fe2651c06a24878571c160aa45c39f27c22786d | 6,813 | py | Python | kapture_localization/evaluation.py | jkabalar/kapture-localization | 647ef7cfdfbdac37297682baca1bf13608b6d6e8 | [
"BSD-3-Clause"
] | 118 | 2020-11-04T16:48:12.000Z | 2022-03-28T13:15:37.000Z | kapture_localization/evaluation.py | jkabalar/kapture-localization | 647ef7cfdfbdac37297682baca1bf13608b6d6e8 | [
"BSD-3-Clause"
] | 23 | 2020-10-19T09:01:37.000Z | 2022-03-25T09:12:31.000Z | kapture_localization/evaluation.py | jkabalar/kapture-localization | 647ef7cfdfbdac37297682baca1bf13608b6d6e8 | [
"BSD-3-Clause"
] | 29 | 2020-11-25T05:28:32.000Z | 2022-03-23T07:20:23.000Z | # Copyright 2020-present NAVER Corp. Under BSD 3-clause license
"""
Evaluation with kapture objects
"""
import math
from typing import Union, List, Tuple, Set
from statistics import mean, median
import kapture
from kapture.algo.pose_operations import world_pose_transform_distance
def evaluate_error_absolute(poses_... | 39.155172 | 112 | 0.695435 | # Copyright 2020-present NAVER Corp. Under BSD 3-clause license
"""
Evaluation with kapture objects
"""
import math
from typing import Union, List, Tuple, Set
from statistics import mean, median
import kapture
from kapture.algo.pose_operations import world_pose_transform_distance
def evaluate_error_absolute(poses_... | 0 | 2,416 | 23 |
510d355be8bbcd29a1567dceb727c6e32a9ba9f3 | 207 | py | Python | config/inte_setting.py | LiuYi217/vxapp | 5a5ba56b80a569359f32ade3b0af10bbbb212ed4 | [
"MIT"
] | null | null | null | config/inte_setting.py | LiuYi217/vxapp | 5a5ba56b80a569359f32ade3b0af10bbbb212ed4 | [
"MIT"
] | null | null | null | config/inte_setting.py | LiuYi217/vxapp | 5a5ba56b80a569359f32ade3b0af10bbbb212ed4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# encoding: utf-8
DEBUG = True
SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = 'mysql://root:mmm13579@127.0.0.1/mysql'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ENCODING = 'utf-8'
| 25.875 | 65 | 0.777778 | #!/usr/bin/python
# encoding: utf-8
DEBUG = True
SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = 'mysql://root:mmm13579@127.0.0.1/mysql'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ENCODING = 'utf-8'
| 0 | 0 | 0 |
d192da251cccad28cae65d992c038d963b0a8f9d | 1,282 | py | Python | Python/Programming Fundamentals/Exams/34. Mu online.py | teodoramilcheva/softuni-software-engineering | 98dc9faa66f42570f6538fd7ef186d2bd1d39bff | [
"MIT"
] | null | null | null | Python/Programming Fundamentals/Exams/34. Mu online.py | teodoramilcheva/softuni-software-engineering | 98dc9faa66f42570f6538fd7ef186d2bd1d39bff | [
"MIT"
] | null | null | null | Python/Programming Fundamentals/Exams/34. Mu online.py | teodoramilcheva/softuni-software-engineering | 98dc9faa66f42570f6538fd7ef186d2bd1d39bff | [
"MIT"
] | null | null | null | initial_health = 100
initial_bitcoins = 0
is_dead = False
rooms = input().split('|')
health = initial_health
bitcoins = initial_bitcoins
max_bitcoins = 0
for i in range(len(rooms)):
command = rooms[i]
tokens = command.split()
if tokens[0] == 'potion':
health_points = int(tokens[1]... | 26.708333 | 53 | 0.548362 | initial_health = 100
initial_bitcoins = 0
is_dead = False
rooms = input().split('|')
health = initial_health
bitcoins = initial_bitcoins
max_bitcoins = 0
for i in range(len(rooms)):
command = rooms[i]
tokens = command.split()
if tokens[0] == 'potion':
health_points = int(tokens[1]... | 0 | 0 | 0 |
cfedbd13a2bd5b26b9b78d94e28e3f4384cb3e68 | 1,912 | py | Python | tests/test_version.py | erny/single-source | 42369f80c4358eb4b41ab33223fe6ddf11a6fc8b | [
"MIT"
] | null | null | null | tests/test_version.py | erny/single-source | 42369f80c4358eb4b41ab33223fe6ddf11a6fc8b | [
"MIT"
] | null | null | null | tests/test_version.py | erny/single-source | 42369f80c4358eb4b41ab33223fe6ddf11a6fc8b | [
"MIT"
] | null | null | null | import sys
import pytest
import toml
from single_source.version import (
VERSION_REGEX,
VersionNotFoundError,
_get_version_from_metadata,
_get_version_from_path,
get_version,
)
| 28.537313 | 84 | 0.763075 | import sys
import pytest
import toml
from single_source.version import (
VERSION_REGEX,
VersionNotFoundError,
_get_version_from_metadata,
_get_version_from_path,
get_version,
)
def test_get_version_from_installed_package(mocker):
expected_version = "2.0.1-alpha.0"
if sys.version_info < ... | 1,593 | 0 | 115 |
4a724414215a7303fef66fcfa40b1c03eadd9074 | 7,353 | py | Python | team_fouls_utils.py | basketballrelativity/team-fouls | 25d917e8ed93477715d063766bd93a601e39e535 | [
"MIT"
] | null | null | null | team_fouls_utils.py | basketballrelativity/team-fouls | 25d917e8ed93477715d063766bd93a601e39e535 | [
"MIT"
] | null | null | null | team_fouls_utils.py | basketballrelativity/team-fouls | 25d917e8ed93477715d063766bd93a601e39e535 | [
"MIT"
] | null | null | null | """
team_fouls_utils.py
This function contains helpful functions for
pulling in basketball data for use by
team_fouls.py
"""
from typing import Union, List, Dict
import pandas as pd
from py_ball import playbyplay, boxscore, scoreboard, player
from team_fouls_constants import TWO_MINUTES
# Header information neede... | 31.969565 | 111 | 0.668571 | """
team_fouls_utils.py
This function contains helpful functions for
pulling in basketball data for use by
team_fouls.py
"""
from typing import Union, List, Dict
import pandas as pd
from py_ball import playbyplay, boxscore, scoreboard, player
from team_fouls_constants import TWO_MINUTES
# Header information neede... | 0 | 0 | 0 |
364d5ac2c9153d854bc157132c92f68efa550bd0 | 566 | py | Python | GettingStarted.py | david-story/audio-steganography-answer-sheet | 6bfe767b65fc30348d7b57a342132b79506ac03e | [
"MIT"
] | null | null | null | GettingStarted.py | david-story/audio-steganography-answer-sheet | 6bfe767b65fc30348d7b57a342132b79506ac03e | [
"MIT"
] | null | null | null | GettingStarted.py | david-story/audio-steganography-answer-sheet | 6bfe767b65fc30348d7b57a342132b79506ac03e | [
"MIT"
] | null | null | null | import wave
import AudioParse
import AudioSteganography
main() | 29.789474 | 68 | 0.726148 | import wave
import AudioParse
import AudioSteganography
def main():
audio = wave.open("TheMoonLanding.wav", "r")
list = AudioParse.parseFrames(audio)
samplerate = audio.getframerate()
encodedAudio = AudioSteganography.encode(list, "test.txt")
AudioParse.writeNewWave(encodedAudio, samplerate, "new.w... | 480 | 0 | 23 |
37db5fedfebd9b1a98b9e6cd317def1f9644a5d8 | 21,790 | py | Python | manim/utils/space_ops.py | fj/manim | ba786fa02c9280d3fb02270ce324549de595ccc7 | [
"MIT"
] | null | null | null | manim/utils/space_ops.py | fj/manim | ba786fa02c9280d3fb02270ce324549de595ccc7 | [
"MIT"
] | null | null | null | manim/utils/space_ops.py | fj/manim | ba786fa02c9280d3fb02270ce324549de595ccc7 | [
"MIT"
] | null | null | null | """Utility functions for two- and three-dimensional vectors."""
__all__ = [
"quaternion_mult",
"quaternion_from_angle_axis",
"angle_axis_from_quaternion",
"quaternion_conjugate",
"rotate_vector",
"thick_diagonal",
"rotation_matrix",
"rotation_about_z",
"z_to_vector",
"angle_of_v... | 27.340025 | 89 | 0.594172 | """Utility functions for two- and three-dimensional vectors."""
__all__ = [
"quaternion_mult",
"quaternion_from_angle_axis",
"angle_axis_from_quaternion",
"quaternion_conjugate",
"rotate_vector",
"thick_diagonal",
"rotation_matrix",
"rotation_about_z",
"z_to_vector",
"angle_of_v... | 2,219 | 0 | 303 |
e0b0287bd128e365d7f24f9666b626810a11f3c2 | 1,522 | py | Python | python/ncmd.py | ytchang05/N-lang | f626dc939b33941f3c2f23a4d1c523b58c847c15 | [
"MIT"
] | null | null | null | python/ncmd.py | ytchang05/N-lang | f626dc939b33941f3c2f23a4d1c523b58c847c15 | [
"MIT"
] | null | null | null | python/ncmd.py | ytchang05/N-lang | f626dc939b33941f3c2f23a4d1c523b58c847c15 | [
"MIT"
] | null | null | null | import inspect
"""
An immutable class representing a command, which is anything that has a side
effect or is asynchronous.
"""
| 34.590909 | 130 | 0.756899 | import inspect
"""
An immutable class representing a command, which is anything that has a side
effect or is asynchronous.
"""
class Cmd:
def __init__(self, performer_getter, map_functions=None, dependent=None):
# A non-async function that, when given the result from `dependent`,
# returns a function (can be asyn... | 1,264 | -11 | 141 |
71bda7f79b072820182085920bfb51f56b2115cf | 132 | py | Python | function_arguments_2.py | godontop/python-work | ea22e0df8b0b17605f5a434e556a388d1f75aa47 | [
"MIT"
] | null | null | null | function_arguments_2.py | godontop/python-work | ea22e0df8b0b17605f5a434e556a388d1f75aa47 | [
"MIT"
] | null | null | null | function_arguments_2.py | godontop/python-work | ea22e0df8b0b17605f5a434e556a388d1f75aa47 | [
"MIT"
] | null | null | null |
my_func(2, 3, 4, 5, 6, a=7, b=8)
| 16.5 | 37 | 0.537879 | def my_func(x, y=7, *args, **kwargs):
print(x)
print(y)
print(args)
print(kwargs)
my_func(2, 3, 4, 5, 6, a=7, b=8)
| 76 | 0 | 22 |
f87492f2e6cf2c9eb3a430a5458e321e63e1f43c | 983 | py | Python | project/fine_tuning_config_file.py | lombardata/Deep_Seatizen | a00fd2f84322fc0f9fb7c0c0cd6e5eea902120dc | [
"Apache-2.0"
] | null | null | null | project/fine_tuning_config_file.py | lombardata/Deep_Seatizen | a00fd2f84322fc0f9fb7c0c0cd6e5eea902120dc | [
"Apache-2.0"
] | null | null | null | project/fine_tuning_config_file.py | lombardata/Deep_Seatizen | a00fd2f84322fc0f9fb7c0c0cd6e5eea902120dc | [
"Apache-2.0"
] | null | null | null |
# Learning rate parameters
BASE_LR = 0.001
EPOCH_DECAY = 30 # number of epochs after which the Learning rate is decayed exponentially.
DECAY_WEIGHT = 0.1 # factor by which the learning rate is reduced.
# DATASET INFO
NUM_CLASSES = 6 # set the number of classes in your dataset
DATA_DIR = 'output_dataset/' # ... | 40.958333 | 116 | 0.741607 |
# Learning rate parameters
BASE_LR = 0.001
EPOCH_DECAY = 30 # number of epochs after which the Learning rate is decayed exponentially.
DECAY_WEIGHT = 0.1 # factor by which the learning rate is reduced.
# DATASET INFO
NUM_CLASSES = 6 # set the number of classes in your dataset
DATA_DIR = 'output_dataset/' # ... | 0 | 0 | 0 |
c88612dc6e20f29325690141bb4629ea2a6ee6b4 | 1,222 | py | Python | sim_access/adapter.py | gdiciocco/sim-access | 5606e53b1fe3f015bf3bf6e20795fdf65e07fe44 | [
"MIT"
] | 44 | 2019-07-05T18:39:01.000Z | 2022-03-24T09:33:45.000Z | sim_access/adapter.py | gdiciocco/sim-access | 5606e53b1fe3f015bf3bf6e20795fdf65e07fe44 | [
"MIT"
] | 1 | 2019-07-12T20:45:10.000Z | 2019-07-16T00:15:50.000Z | sim_access/adapter.py | gdiciocco/sim-access | 5606e53b1fe3f015bf3bf6e20795fdf65e07fe44 | [
"MIT"
] | 8 | 2020-06-23T08:45:38.000Z | 2022-01-26T20:26:49.000Z | import logging
import sys
import time
from abc import ABCMeta, abstractmethod
import serial
import six
logger = logging.getLogger(__name__)
@six.add_metaclass(ABCMeta)
| 21.068966 | 75 | 0.640753 | import logging
import sys
import time
from abc import ABCMeta, abstractmethod
import serial
import six
logger = logging.getLogger(__name__)
@six.add_metaclass(ABCMeta)
class AdapterBase(object):
@abstractmethod
def read(self, size=0):
raise NotImplementedError()
@abstractmethod
def readli... | 658 | 205 | 184 |
badc6e29375c645c1b28d9cf77087170e354ff44 | 10,938 | py | Python | pychemy/tests/test_peptide_sets.py | benjiec/pychemy | 0b496b158ad48defc61a9688c91ce676e1f6a8a4 | [
"MIT"
] | 7 | 2015-04-16T21:46:50.000Z | 2020-09-20T13:49:37.000Z | pychemy/tests/test_peptide_sets.py | timgc/pychemy | d45450ad11c93a3e06d80f8f2bd72777b77a1272 | [
"MIT"
] | 6 | 2015-01-20T15:21:41.000Z | 2017-04-12T19:03:15.000Z | pychemy/tests/test_peptide_sets.py | timgc/pychemy | d45450ad11c93a3e06d80f8f2bd72777b77a1272 | [
"MIT"
] | 6 | 2015-01-15T14:36:11.000Z | 2017-07-21T13:38:17.000Z | import unittest, tempfile, os
from pychemy.peptide_sets import *
import random
import numpy as np
AA_dict = {1:'A', 2:'C', 3:'D', 4:'E', 5:'F', 6:'G', 7:'H', 8:'I', 9:'L', 10:'K',
11:'M', 12:'N', 13:'P', 14:'Q', 15:'R', 16:'S', 17:'T', 18:'V', 19:'W', 20:'Y'}
###############################
######... | 40.813433 | 121 | 0.665661 | import unittest, tempfile, os
from pychemy.peptide_sets import *
import random
import numpy as np
AA_dict = {1:'A', 2:'C', 3:'D', 4:'E', 5:'F', 6:'G', 7:'H', 8:'I', 9:'L', 10:'K',
11:'M', 12:'N', 13:'P', 14:'Q', 15:'R', 16:'S', 17:'T', 18:'V', 19:'W', 20:'Y'}
def gen_protein(num_AA = 20):
out = ''
for... | 9,243 | 24 | 876 |
7e13dbb1b3a3aa5363cb1bf11d50b64aa620c142 | 5,757 | py | Python | ptfims/ptfimages.py | rbiswas4/ptfdata | f50efd077bbf091e5108a6c95b0e24e4768ca4e6 | [
"MIT"
] | null | null | null | ptfims/ptfimages.py | rbiswas4/ptfdata | f50efd077bbf091e5108a6c95b0e24e4768ca4e6 | [
"MIT"
] | null | null | null | ptfims/ptfimages.py | rbiswas4/ptfdata | f50efd077bbf091e5108a6c95b0e24e4768ca4e6 | [
"MIT"
] | null | null | null | """
Objects related to data downloads from the public PTF data server. Based on information and examples
in
Should work in python 2 and 3.
"""
import requests
import pandas as pd
from future.standard_library import install_aliases
install_aliases()
from urllib.request import urlopen
import os
__all__ = ['PTFImages'... | 31.459016 | 111 | 0.565225 | """
Objects related to data downloads from the public PTF data server. Based on information and examples
in
Should work in python 2 and 3.
"""
import requests
import pandas as pd
from future.standard_library import install_aliases
install_aliases()
from urllib.request import urlopen
import os
__all__ = ['PTFImages'... | 283 | 0 | 26 |
30cdf94148776cd17491b400029fd14187eb1ef3 | 385 | py | Python | tests/test_laplacians.py | gut-space/analog-noise-estimator | 1faaac363268522941e694a6caf1814c83a5e745 | [
"MIT"
] | 1 | 2021-02-08T19:35:05.000Z | 2021-02-08T19:35:05.000Z | tests/test_laplacians.py | gut-space/analog-noise-estimator | 1faaac363268522941e694a6caf1814c83a5e745 | [
"MIT"
] | null | null | null | tests/test_laplacians.py | gut-space/analog-noise-estimator | 1faaac363268522941e694a6caf1814c83a5e745 | [
"MIT"
] | null | null | null | import unittest
from analog_noise_estimator import laplacians | 29.615385 | 64 | 0.602597 | import unittest
from analog_noise_estimator import laplacians
class LaplaciansTest(unittest.TestCase):
def test_elements_sum(self):
matrixes = [laplacians.L3, laplacians.L5, laplacians.L7]
for matrix in matrixes:
acc = 0
for row in matrix:
for val in row:
... | 255 | 19 | 49 |
1cbfbe88c19bcd6106687fbc596a103924b041e1 | 8,152 | py | Python | analyze-go-test-output.py | knz/go-test-stats | 64cd252e30a8ea8cd1a6f414dfce00c6b5bf92c2 | [
"BSD-3-Clause"
] | null | null | null | analyze-go-test-output.py | knz/go-test-stats | 64cd252e30a8ea8cd1a6f414dfce00c6b5bf92c2 | [
"BSD-3-Clause"
] | null | null | null | analyze-go-test-output.py | knz/go-test-stats | 64cd252e30a8ea8cd1a6f414dfce00c6b5bf92c2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import re
import sys
import codecs
inputfile = codecs.open(sys.argv[1], mode='r', encoding='utf-8', errors='replace')
lineprefix = re.compile(r'^(?P<time>\d+)\s+(?P<rss>\d+)\s+(?P<cpu>\d+\.\d+)\s+(?P<th>\d+) (?P<msg>.*)$')
pkgre = re.compile(r'^(?P<result>(?:FAIL|ok |\? ))\tgithub.com/... | 35.137931 | 142 | 0.563788 | #!/usr/bin/env python3
import re
import sys
import codecs
class Trackable:
def __init__(self):
self.last_ts = None
self.time = 0
self.maxcpu = 0.0
self.maxrss = 0
self.maxth = 0
self.nlines = 0
self.nbytes = 0
def update(self, time, rss, cpu, th, nb):
... | 2,913 | 2 | 390 |
2b3b5f9c1818f1209dbb09c1b256353b4ff7f385 | 150 | py | Python | tooltime/timefrequency_utils/__init__.py | sslivkoff/tooltime | 61ce58490f679fcf29aa284a8f5acc2133afaf9c | [
"Apache-2.0"
] | null | null | null | tooltime/timefrequency_utils/__init__.py | sslivkoff/tooltime | 61ce58490f679fcf29aa284a8f5acc2133afaf9c | [
"Apache-2.0"
] | null | null | null | tooltime/timefrequency_utils/__init__.py | sslivkoff/tooltime | 61ce58490f679fcf29aa284a8f5acc2133afaf9c | [
"Apache-2.0"
] | null | null | null | from .timefrequency_convert import *
from .timefrequency_crud import *
from .timefrequency_identify import *
from .timefrequency_resolution import *
| 25 | 39 | 0.833333 | from .timefrequency_convert import *
from .timefrequency_crud import *
from .timefrequency_identify import *
from .timefrequency_resolution import *
| 0 | 0 | 0 |
5f3dee0d05189e8ff28b4293a04aea08f081dbd8 | 320 | py | Python | tests/models/classes/test_BaseODM.py | RenoirTan/TodoListBackend | 149bdf1d883891c87b27f01996816bff251f11d8 | [
"MIT"
] | null | null | null | tests/models/classes/test_BaseODM.py | RenoirTan/TodoListBackend | 149bdf1d883891c87b27f01996816bff251f11d8 | [
"MIT"
] | null | null | null | tests/models/classes/test_BaseODM.py | RenoirTan/TodoListBackend | 149bdf1d883891c87b27f01996816bff251f11d8 | [
"MIT"
] | null | null | null | from todolist_backend.models.classes import BaseODM
| 21.333333 | 67 | 0.765625 | from todolist_backend.models.classes import BaseODM
class Example(BaseODM):
pass
def test_collection_name():
assert Example.collection_name() == "Examples"
def test_setup_odm():
Example.setup_odm(collection="CompletelyArbitraryName")
assert Example._meta["collection"] == "CompletelyArbitraryName"
| 185 | 11 | 69 |
ee446f4118c306613174ec62943e5d94d1d16caa | 568 | py | Python | python/restb/sdk/__init__.py | restbai/sdk | d39a2ad828a897c431cae1a8270fee9a3973beda | [
"Apache-2.0"
] | 3 | 2018-10-17T14:16:25.000Z | 2021-08-24T15:05:36.000Z | python/restb/sdk/__init__.py | restbai/sdk | d39a2ad828a897c431cae1a8270fee9a3973beda | [
"Apache-2.0"
] | 1 | 2020-04-30T06:34:15.000Z | 2020-04-30T08:29:54.000Z | python/restb/sdk/__init__.py | restbai/sdk | d39a2ad828a897c431cae1a8270fee9a3973beda | [
"Apache-2.0"
] | 3 | 2018-04-27T08:41:07.000Z | 2021-08-25T11:02:25.000Z | __URL_EU = 'https://api-eu.restb.ai'
__URL_US = 'https://api-us.restb.ai'
__ENDPOINT = '/vision/v2/predict'
__ENDPOINT_MULTIPREDICT = '/vision/v2/multipredict'
__MODELS = [
're_roomtype_global_v2',
're_exterior_styles',
're_features_v3',
're_logo',
're_appliances_v2',
're_compliance',
're_co... | 18.933333 | 51 | 0.637324 | __URL_EU = 'https://api-eu.restb.ai'
__URL_US = 'https://api-us.restb.ai'
__ENDPOINT = '/vision/v2/predict'
__ENDPOINT_MULTIPREDICT = '/vision/v2/multipredict'
__MODELS = [
're_roomtype_global_v2',
're_exterior_styles',
're_features_v3',
're_logo',
're_appliances_v2',
're_compliance',
're_co... | 0 | 0 | 0 |
7df64d610ab8de5462e95353380398072838bf85 | 2,454 | py | Python | normalized_and_show.py | GhozyElFatih/Skripsi-Automatic-Velocity-Pick-Seismic-Reflection-Using-CNN | 438e8d950546bf3668cc37a86914187f1b5f23c8 | [
"Apache-2.0"
] | 3 | 2021-07-24T10:34:39.000Z | 2022-03-28T06:40:36.000Z | normalized_and_show.py | GhozyElFatih/Skripsi-Automatic-Velocity-Pick-Seismic-Reflection-Using-CNN | 438e8d950546bf3668cc37a86914187f1b5f23c8 | [
"Apache-2.0"
] | null | null | null | normalized_and_show.py | GhozyElFatih/Skripsi-Automatic-Velocity-Pick-Seismic-Reflection-Using-CNN | 438e8d950546bf3668cc37a86914187f1b5f23c8 | [
"Apache-2.0"
] | 2 | 2021-08-12T23:46:31.000Z | 2022-01-24T14:24:15.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 9 14:01:42 2021
@author: Ghozy El Fatih
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.interpolate as inter
from PIL import Image
#load gambar semblance
path_gambar = "IMAGE_PATH\\"
path_pick = "PICK_PATH\\normpick"... | 27.266667 | 119 | 0.643439 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 9 14:01:42 2021
@author: Ghozy El Fatih
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.interpolate as inter
from PIL import Image
#load gambar semblance
path_gambar = "IMAGE_PATH\\"
path_pick = "PICK_PATH\\normpick"... | 124 | 0 | 23 |
18c6dc15b1e208d0df26cb6354275f4f274f6602 | 957 | py | Python | Site_Visit_2.0/venv/lib/python3.7/site-packages/google_streetview/__init__.py | opacichjj/FEMA-PDA-and-Route-Optimizer | d79468438f45216d5abeef5f5037d6a165f61140 | [
"MIT"
] | null | null | null | Site_Visit_2.0/venv/lib/python3.7/site-packages/google_streetview/__init__.py | opacichjj/FEMA-PDA-and-Route-Optimizer | d79468438f45216d5abeef5f5037d6a165f61140 | [
"MIT"
] | null | null | null | Site_Visit_2.0/venv/lib/python3.7/site-packages/google_streetview/__init__.py | opacichjj/FEMA-PDA-and-Route-Optimizer | d79468438f45216d5abeef5f5037d6a165f61140 | [
"MIT"
] | 2 | 2019-08-11T03:34:07.000Z | 2019-10-25T16:57:48.000Z | # -*- coding: utf-8 -*-
__name__ = 'google_streetview'
__author__ = 'Richard Wen'
__email__ = 'rrwen.dev@gmail.com'
__version__ = '1.2.9'
__license__ = 'MIT'
__description__ = 'A command line tool and module for Google Street View Image API.'
__long_description_content_type__='text/markdown'
__keywords__ = [
... | 23.925 | 88 | 0.661442 | # -*- coding: utf-8 -*-
__name__ = 'google_streetview'
__author__ = 'Richard Wen'
__email__ = 'rrwen.dev@gmail.com'
__version__ = '1.2.9'
__license__ = 'MIT'
__description__ = 'A command line tool and module for Google Street View Image API.'
__long_description_content_type__='text/markdown'
__keywords__ = [
... | 0 | 0 | 0 |
1eed03c51ed8db36a2820c373473c253728f62ea | 123 | py | Python | projects/oldProyects/workStress/configuration/workload_settings.py | GGP00/soba | c193f323f26eccf579a454b8bb4bec4e80644444 | [
"MIT"
] | 1 | 2017-03-06T12:33:02.000Z | 2017-03-06T12:33:02.000Z | projects/oldProyects/workStress/configuration/workload_settings.py | GGP00/soba | c193f323f26eccf579a454b8bb4bec4e80644444 | [
"MIT"
] | 3 | 2017-04-26T08:57:35.000Z | 2019-04-24T08:28:24.000Z | projects/oldProyects/workStress/configuration/workload_settings.py | GGP00/soba | c193f323f26eccf579a454b8bb4bec4e80644444 | [
"MIT"
] | 1 | 2019-01-20T17:39:00.000Z | 2019-01-20T17:39:00.000Z |
task_estimated_time = 25 # minutes
tasks_arriving_distribution_params = 20, 6 # normal distribution with mean 20 and sd 6
| 30.75 | 86 | 0.804878 |
task_estimated_time = 25 # minutes
tasks_arriving_distribution_params = 20, 6 # normal distribution with mean 20 and sd 6
| 0 | 0 | 0 |
490619810fdcb1508202ace900b9fb1de251191e | 358 | py | Python | exercicios/tuplas/desafio72.py | costagguilherme/python-desafios | 404b4a8924a2895a97d3cea99e1325e46d9aee39 | [
"MIT"
] | null | null | null | exercicios/tuplas/desafio72.py | costagguilherme/python-desafios | 404b4a8924a2895a97d3cea99e1325e46d9aee39 | [
"MIT"
] | null | null | null | exercicios/tuplas/desafio72.py | costagguilherme/python-desafios | 404b4a8924a2895a97d3cea99e1325e46d9aee39 | [
"MIT"
] | null | null | null | a = ('zero', 'um', 'dois', 'três', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', 'dez', 'onze', 'doze', 'treze', 'cartoze', 'quinze')
n = int(input('DIGITE UM NÚMERO DE 0 A 15: '))
if n > 15 or n < 0:
while True:
n = int(input('DIGITE UM NÚMERO DE 0 A 15: '))
if 0 <= n <= 15:
break
... | 44.75 | 138 | 0.513966 | a = ('zero', 'um', 'dois', 'três', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', 'dez', 'onze', 'doze', 'treze', 'cartoze', 'quinze')
n = int(input('DIGITE UM NÚMERO DE 0 A 15: '))
if n > 15 or n < 0:
while True:
n = int(input('DIGITE UM NÚMERO DE 0 A 15: '))
if 0 <= n <= 15:
break
... | 0 | 0 | 0 |
2eb2d362919c329715fd21a58405ff4a02c3c106 | 1,075 | py | Python | src/main/python/daggit/core/operators/operators_registry.py | SMYALTAMASH/sunbird-ml-workbench | d7a92e77cab89b5b720c2ac1b013d611c76b1636 | [
"MIT"
] | null | null | null | src/main/python/daggit/core/operators/operators_registry.py | SMYALTAMASH/sunbird-ml-workbench | d7a92e77cab89b5b720c2ac1b013d611c76b1636 | [
"MIT"
] | null | null | null | src/main/python/daggit/core/operators/operators_registry.py | SMYALTAMASH/sunbird-ml-workbench | d7a92e77cab89b5b720c2ac1b013d611c76b1636 | [
"MIT"
] | null | null | null | import importlib
import os
testdir = os.path.dirname(os.path.realpath("__file__"))
srcdir = 'src/main/python/daggit'
abs_path = os.path.join(testdir, srcdir)
| 35.833333 | 85 | 0.605581 | import importlib
import os
testdir = os.path.dirname(os.path.realpath("__file__"))
srcdir = 'src/main/python/daggit'
abs_path = os.path.join(testdir, srcdir)
def get_op_callable(operator, module_path=None):
if module_path:
module = importlib.import_module(module_path)
return getattr(module, opera... | 892 | 0 | 23 |
a94b1427bfaba70e4767ee6292e3e96846691f1c | 932 | py | Python | setup.py | sonwanesuresh95/rfm | f72d9fd672c6394ccef058698e2f6c9d87ebcea9 | [
"MIT"
] | 2 | 2022-02-13T14:54:06.000Z | 2022-02-13T16:14:17.000Z | setup.py | sonwanesuresh95/rfm | f72d9fd672c6394ccef058698e2f6c9d87ebcea9 | [
"MIT"
] | null | null | null | setup.py | sonwanesuresh95/rfm | f72d9fd672c6394ccef058698e2f6c9d87ebcea9 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="rfm",
version="1.0.7",
author="Suresh Sonwane",
author_email="sonwanesuresh739@gmail.com",
description="Python Package for RFM Analysis and Customer Segmentatio... | 33.285714 | 77 | 0.63412 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="rfm",
version="1.0.7",
author="Suresh Sonwane",
author_email="sonwanesuresh739@gmail.com",
description="Python Package for RFM Analysis and Customer Segmentatio... | 0 | 0 | 0 |
554833401b3b1ccb1b26746f60dab3c1b0d0da9b | 639 | py | Python | code/histogram2.py | josemac95/umucv | f0f8de17141f4adcb4966281c3f83539ebda5f0b | [
"BSD-3-Clause"
] | null | null | null | code/histogram2.py | josemac95/umucv | f0f8de17141f4adcb4966281c3f83539ebda5f0b | [
"BSD-3-Clause"
] | null | null | null | code/histogram2.py | josemac95/umucv | f0f8de17141f4adcb4966281c3f83539ebda5f0b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
cap = cv.VideoCapture(0)
plt.ion()
fig = plt.figure(figsize=(10,3))
fig.suptitle('histogram')
ax = fig.add_axes([-0.25,0,1,1])
im = ax.imshow(np.zeros((480,640)),'gray',vmin=0,vmax=255)
ax.set_axis_off();
ax2 = fig.add_axes([... | 17.75 | 58 | 0.633803 | #!/usr/bin/env python
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
cap = cv.VideoCapture(0)
plt.ion()
fig = plt.figure(figsize=(10,3))
fig.suptitle('histogram')
ax = fig.add_axes([-0.25,0,1,1])
im = ax.imshow(np.zeros((480,640)),'gray',vmin=0,vmax=255)
ax.set_axis_off();
ax2 = fig.add_axes([... | 0 | 0 | 0 |
0aa4c004d950dee31e99f975dd87127dda9b82b3 | 502 | py | Python | services/trainer/models/random_forest.py | ZeshanA/transport | cf69d0cd598a82657f4b2fe88151eccdd7e96cc5 | [
"MIT"
] | 1 | 2019-02-06T21:11:29.000Z | 2019-02-06T21:11:29.000Z | services/trainer/models/random_forest.py | ZeshanA/transport | cf69d0cd598a82657f4b2fe88151eccdd7e96cc5 | [
"MIT"
] | 5 | 2019-02-10T13:09:13.000Z | 2021-03-09T08:26:51.000Z | services/trainer/models/random_forest.py | ZeshanA/transport | cf69d0cd598a82657f4b2fe88151eccdd7e96cc5 | [
"MIT"
] | null | null | null | import logging
from sklearn.ensemble import RandomForestRegressor
from skopt.space import Integer
from lib.models import SKModel
| 25.1 | 66 | 0.705179 | import logging
from sklearn.ensemble import RandomForestRegressor
from skopt.space import Integer
from lib.models import SKModel
class RandomForestModel(SKModel):
param_dist = [Integer(5, 200, name='n_estimators')]
default_params = {'n_estimators': 200}
@staticmethod
def create_model(n_estimators=d... | 191 | 156 | 23 |
3764428cb40418d1bea243daa485fb13b1170b84 | 1,735 | py | Python | persianas_paludo/src/webapps/render_admin.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | persianas_paludo/src/webapps/render_admin.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | 1 | 2015-11-08T11:49:35.000Z | 2015-11-08T11:49:43.000Z | persianas_paludo/src/webapps/render_admin.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from web import template
from configuration import WEBSITE_NAME, ADMIN_VERSION
from auth import get_logged_user, get_logoff_url
from model import get_exposed_managed_tables
import os
rootpath = os.path.abspath(os.path.dirname(__file__))
admin_template_path = templat... | 44.487179 | 190 | 0.720461 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from web import template
from configuration import WEBSITE_NAME, ADMIN_VERSION
from auth import get_logged_user, get_logoff_url
from model import get_exposed_managed_tables
import os
rootpath = os.path.abspath(os.path.dirname(__file__))
admin_template_path = templat... | 1,211 | 0 | 150 |
b51ed79dae925590265e59bda7e40da317ae77a7 | 24 | py | Python | smop/version.py | pokepocky/smop | f6c1aa037be8511d29fa014c9ed1fbf50e4cc3d5 | [
"MIT"
] | 961 | 2015-01-26T09:23:52.000Z | 2022-03-31T15:02:53.000Z | smop/version.py | SylivanKenobi/smop | 1bd8da0a5fc9c2b1e11b2225cbfd48d031338413 | [
"MIT"
] | 109 | 2015-02-02T15:38:35.000Z | 2022-02-26T17:30:59.000Z | smop/version.py | SylivanKenobi/smop | 1bd8da0a5fc9c2b1e11b2225cbfd48d031338413 | [
"MIT"
] | 432 | 2015-01-09T22:51:59.000Z | 2022-03-24T03:52:18.000Z | __version__='0.41-beta'
| 12 | 23 | 0.75 | __version__='0.41-beta'
| 0 | 0 | 0 |
a231d1ef70774edb07cc728aa587a4c927381f7d | 5,581 | py | Python | Data-Store/log_csv_to_influx.py | prashnts/MPU-9250 | 29b0223ef5a0cfe5e68b09c752478f445ecc2629 | [
"MIT"
] | null | null | null | Data-Store/log_csv_to_influx.py | prashnts/MPU-9250 | 29b0223ef5a0cfe5e68b09c752478f445ecc2629 | [
"MIT"
] | null | null | null | Data-Store/log_csv_to_influx.py | prashnts/MPU-9250 | 29b0223ef5a0cfe5e68b09c752478f445ecc2629 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import serial
import click
import platform
import glob
import json
import signal
import sys
from itertools import cycle
from influxdb import InfluxDBClient
serial_port = serial.Serial()
client = None
progress_pool = cycle(["_ ", "__ ", "___"])
@click.command()
@click.o... | 31.891429 | 115 | 0.501165 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import serial
import click
import platform
import glob
import json
import signal
import sys
from itertools import cycle
from influxdb import InfluxDBClient
serial_port = serial.Serial()
client = None
progress_pool = cycle(["_ ", "__ ", "___"])
@click.command()
@click.o... | 0 | 0 | 0 |
f66fdc33c2ab615ae856da99d08f9b8afc21fa33 | 3,576 | py | Python | libcloud/test/storage/test_rgw.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | null | null | null | libcloud/test/storage/test_rgw.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | 1 | 2021-12-06T12:29:13.000Z | 2021-12-06T12:29:13.000Z | libcloud/test/storage/test_rgw.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | 1 | 2019-08-05T10:12:02.000Z | 2019-08-05T10:12:02.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 36.865979 | 83 | 0.744407 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 1,677 | 655 | 69 |
eff9dee89b87dcc9b432a833a6cd426e6cf3b727 | 4,714 | py | Python | pyneval/metric/utils/klib/glib/Writer.py | SupermeLC/PyNeval | 2cccfb1af7d97857454e9cbc3515ba75e5d8d4b0 | [
"BSD-3-Clause"
] | 12 | 2020-07-18T16:55:23.000Z | 2022-03-14T12:26:08.000Z | pyneval/metric/utils/klib/glib/Writer.py | SupermeLC/PyNeval | 2cccfb1af7d97857454e9cbc3515ba75e5d8d4b0 | [
"BSD-3-Clause"
] | 5 | 2021-05-31T22:08:51.000Z | 2021-08-31T15:42:44.000Z | pyneval/metric/utils/klib/glib/Writer.py | SupermeLC/PyNeval | 2cccfb1af7d97857454e9cbc3515ba75e5d8d4b0 | [
"BSD-3-Clause"
] | 2 | 2021-09-24T03:02:27.000Z | 2021-11-09T06:21:00.000Z | """Converts images to TFRecords file format with Example protos."""
import os
import sys
import glob
import json
import tensorflow as tf
from PIL import Image
import tifffile
import numpy as np
import Utils
from Label import class2label
def convertTo(
input_path_list,
output_path,
class_label_file_path... | 30.61039 | 107 | 0.522486 | """Converts images to TFRecords file format with Example protos."""
import os
import sys
import glob
import json
import tensorflow as tf
from PIL import Image
import tifffile
import numpy as np
import Utils
from Label import class2label
def _int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64L... | 2,225 | 0 | 69 |
b182bb0a90f70e58864aa0547270a6ef6118570b | 12,029 | py | Python | nxjiggle.py | henrycousins/nxviz | f198abcf0dcd6076a0488026454599e574d91812 | [
"MIT"
] | null | null | null | nxjiggle.py | henrycousins/nxviz | f198abcf0dcd6076a0488026454599e574d91812 | [
"MIT"
] | null | null | null | nxjiggle.py | henrycousins/nxviz | f198abcf0dcd6076a0488026454599e574d91812 | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
import glob as glob
import matplotlib.pyplot as plt
# import scipy.stats
# import seaborn as sns
# from sklearn import metrics as skm
import math
from collections import Counter
import networkx as nx
import matplotlib.lines as mlines
from itertools import combinations
im... | 31.244156 | 107 | 0.614349 | import os
import numpy as np
import pandas as pd
import glob as glob
import matplotlib.pyplot as plt
# import scipy.stats
# import seaborn as sns
# from sklearn import metrics as skm
import math
from collections import Counter
import networkx as nx
import matplotlib.lines as mlines
from itertools import combinations
im... | 4,717 | 0 | 230 |
fc9b84923f35af717f9f21aed7a6365e3de00e9c | 3,704 | py | Python | tcfcli/cmds/configure/add/cli.py | tencentyun/scfcli | ef15508ad34a851cf0d2750dfaa5202f6a600887 | [
"Apache-2.0"
] | 103 | 2019-06-11T06:09:56.000Z | 2021-12-18T22:48:59.000Z | tcfcli/cmds/configure/add/cli.py | TencentCloud/Serverless-cli | 57f98b24cfd10712770a4806212cfb69d981a11a | [
"Apache-2.0"
] | 8 | 2019-07-12T12:08:40.000Z | 2020-10-20T07:18:17.000Z | tcfcli/cmds/configure/add/cli.py | TencentCloud/Serverless-cli | 57f98b24cfd10712770a4806212cfb69d981a11a | [
"Apache-2.0"
] | 49 | 2019-06-11T06:26:05.000Z | 2020-02-19T08:13:36.000Z | # -*- coding: utf-8 -*-
import click
import platform
import tcfcli.common.base_infor as infor
from tcfcli.help.message import ConfigureHelp as help
from tcfcli.common.user_config import UserConfig
from tcfcli.common.operation_msg import Operation
version = platform.python_version()
if version >= '3':
from functoo... | 37.04 | 134 | 0.559125 | # -*- coding: utf-8 -*-
import click
import platform
import tcfcli.common.base_infor as infor
from tcfcli.help.message import ConfigureHelp as help
from tcfcli.common.user_config import UserConfig
from tcfcli.common.operation_msg import Operation
version = platform.python_version()
if version >= '3':
from functoo... | 26 | 0 | 50 |
ba82528a0f42d23f98e41a9048c283ba45dd1e41 | 296 | py | Python | class4/exercise4.py | papri-entropy/pyplus | 9791fa6ee0b5414912594e20db0390f8a65c91fc | [
"MIT"
] | null | null | null | class4/exercise4.py | papri-entropy/pyplus | 9791fa6ee0b5414912594e20db0390f8a65c91fc | [
"MIT"
] | null | null | null | class4/exercise4.py | papri-entropy/pyplus | 9791fa6ee0b5414912594e20db0390f8a65c91fc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
4. Use TextFSM to parse the 'show arp' output from a Juniper SRX (see link below).
Extract the following fields into tabular data: MAC Address, Address, Name, Interface.
https://github.com/ktbyers/pyplus_course/blob/master/class4/exercises/ex4_junos_show_arp.txt
"""
| 32.888889 | 92 | 0.763514 | #!/usr/bin/env python
"""
4. Use TextFSM to parse the 'show arp' output from a Juniper SRX (see link below).
Extract the following fields into tabular data: MAC Address, Address, Name, Interface.
https://github.com/ktbyers/pyplus_course/blob/master/class4/exercises/ex4_junos_show_arp.txt
"""
| 0 | 0 | 0 |
7900ba4754c926164dd2748f4d59fd2fbccbf00f | 8,660 | py | Python | resolwe_bio/processes/import_data/basespace.py | plojyon/resolwe-bio | 45d001a78fcc387b5e3239a34c9da7f40d789022 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/processes/import_data/basespace.py | plojyon/resolwe-bio | 45d001a78fcc387b5e3239a34c9da7f40d789022 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/processes/import_data/basespace.py | plojyon/resolwe-bio | 45d001a78fcc387b5e3239a34c9da7f40d789022 | [
"Apache-2.0"
] | null | null | null | """Import a file from Illumina BaseSpace."""
import atexit
import gzip
import os
import time
import traceback
from pathlib import Path
from requests import RequestException, Session
from resolwe.process import (
BooleanField,
FileField,
GroupField,
IntegerField,
Persistence,
Process,
Secr... | 31.376812 | 95 | 0.588337 | """Import a file from Illumina BaseSpace."""
import atexit
import gzip
import os
import time
import traceback
from pathlib import Path
from requests import RequestException, Session
from resolwe.process import (
BooleanField,
FileField,
GroupField,
IntegerField,
Persistence,
Process,
Secr... | 0 | 0 | 0 |
0719682377cb262b97f21fa7de66ec6aca54b249 | 3,181 | py | Python | parse_wiki.py | woctezuma/humble-monthly | 655b42a452f4db168d03ebb146196940822687d6 | [
"MIT"
] | 3 | 2019-03-11T12:35:53.000Z | 2021-09-11T18:14:09.000Z | parse_wiki.py | woctezuma/humble-monthly | 655b42a452f4db168d03ebb146196940822687d6 | [
"MIT"
] | 41 | 2018-06-06T21:11:48.000Z | 2022-02-01T19:46:16.000Z | parse_wiki.py | woctezuma/humble-monthly | 655b42a452f4db168d03ebb146196940822687d6 | [
"MIT"
] | null | null | null | import re
if __name__ == '__main__':
filename = 'data/wiki_humble_monthly.txt'
verbose = True
bundles = build_dictionary(filename, verbose)
print(bundles)
| 29.453704 | 102 | 0.638478 | import re
def load_wiki_file(fname):
with open(fname, encoding='utf8') as f:
lines = [l.strip() for l in f.readlines()]
return lines
def parse_bundle_name(wiki_str):
# Tokenize
wiki_tokens = re.split('\|', wiki_str)
bundle_name_prefix = 'Bundle='
# Find the token corresponding to ... | 2,912 | 0 | 92 |
d52c98485e83b7d36f5dea9869ebad3affbd4222 | 140 | py | Python | pyaz/mysql/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/mysql/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/mysql/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | 1 | 2022-02-03T09:12:01.000Z | 2022-02-03T09:12:01.000Z | '''
Manage Azure Database for MySQL servers.
'''
from .. pyaz_utils import _call_az
from . import db, flexible_server, server, server_logs
| 20 | 54 | 0.757143 | '''
Manage Azure Database for MySQL servers.
'''
from .. pyaz_utils import _call_az
from . import db, flexible_server, server, server_logs
| 0 | 0 | 0 |
b3f3a1548b2bc6caf79b557abc8eb38c923388f1 | 3,277 | py | Python | generate_feats1.py | mohsinkhn/ltfs-av | 43077049b817e6eb0a8a8a2bf0177c9a1d9940d0 | [
"MIT"
] | 5 | 2019-04-26T20:07:30.000Z | 2021-02-04T20:24:34.000Z | generate_feats1.py | mohsinkhn/ltfs-av | 43077049b817e6eb0a8a8a2bf0177c9a1d9940d0 | [
"MIT"
] | null | null | null | generate_feats1.py | mohsinkhn/ltfs-av | 43077049b817e6eb0a8a8a2bf0177c9a1d9940d0 | [
"MIT"
] | 1 | 2019-04-29T09:45:12.000Z | 2019-04-29T09:45:12.000Z | import pandas as pd
import numpy as np
from pathlib import Path
from sklearn.preprocessing import QuantileTransformer, StandardScaler, LabelEncoder
from utils import read_data
from config import UTILITY
if __name__=="__main__":
print("Reading data")
train = read_data("train")
test = read_data("t... | 41.481013 | 118 | 0.683552 | import pandas as pd
import numpy as np
from pathlib import Path
from sklearn.preprocessing import QuantileTransformer, StandardScaler, LabelEncoder
from utils import read_data
from config import UTILITY
def preprocess_data(train , test):
lbl = LabelEncoder()
train["cns_desc"] = lbl.fit_transform(train["PERF... | 1,952 | 0 | 93 |
9f23764bed3fe6abe03a4a30739c191dd08836b0 | 1,073 | py | Python | config.py | JeyDi/GameOfLife | 963d2d084e82321eb814e07d146af9af4e6106ff | [
"MIT"
] | null | null | null | config.py | JeyDi/GameOfLife | 963d2d084e82321eb814e07d146af9af4e6106ff | [
"MIT"
] | null | null | null | config.py | JeyDi/GameOfLife | 963d2d084e82321eb814e07d146af9af4e6106ff | [
"MIT"
] | null | null | null | import os
import logging
from logging.handlers import RotatingFileHandler
# Set the logs
VERBOSITY = os.getenv(
"VERBOSITY", "debug"
) # info as default, #debug for local dev
LOG_PATH = os.getenv("LOG_PATH", "./logs")
# Define the logs
# Set verbosity
ROWS = 40
COLUMNS = 40
MAX_PROB = 2
MAX_TICK = 60
| 24.953488 | 91 | 0.580615 | import os
import logging
from logging.handlers import RotatingFileHandler
# Set the logs
VERBOSITY = os.getenv(
"VERBOSITY", "debug"
) # info as default, #debug for local dev
LOG_PATH = os.getenv("LOG_PATH", "./logs")
# Define the logs
# Set verbosity
def configure_logging(verbosity=VERBOSITY, log_path=LOG_PAT... | 738 | 0 | 22 |
7cf55ebe1e6cab7576145b36cea9f7fb4961dc39 | 587 | py | Python | LeetCodeSolutions/python/6_ZigZag_Conversion.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | 1 | 2017-03-27T13:38:37.000Z | 2017-03-27T13:38:37.000Z | LeetCodeSolutions/python/6_ZigZag_Conversion.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | null | null | null | LeetCodeSolutions/python/6_ZigZag_Conversion.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | null | null | null |
str = 'ABC'
print Solution().convert(str, 1) | 24.458333 | 54 | 0.410562 | class Solution(object):
def convert(self, s, numRows):
"""
:type s: str
:type numRows: int
:rtype: str
"""
if numRows <= 1 or numRows >= len(s): return s
strs = [''] * numRows
row, step = 0, 1
for i in range(len(s)):
strs[row] += s[... | 0 | 520 | 22 |
dcf43379ba8d2124b5769ec2be6a5f3b4c271a9a | 2,301 | py | Python | examples/key_view.py | claws/txcosm | c5289bcb40de46a3fc4b854476d36c4839f50e45 | [
"MIT"
] | null | null | null | examples/key_view.py | claws/txcosm | c5289bcb40de46a3fc4b854476d36c4839f50e45 | [
"MIT"
] | null | null | null | examples/key_view.py | claws/txcosm | c5289bcb40de46a3fc4b854476d36c4839f50e45 | [
"MIT"
] | 1 | 2018-03-04T20:14:04.000Z | 2018-03-04T20:14:04.000Z | #!/usr/bin/env python
"""
Lists key(s) detail(s) visible to the supplied Cosm user API key
To use this script you must create a text file containing your API key
and pass it to this script using the --keyfile argument as follows:
List all keys visible to supplied key:
$ key_view.py --keyfile=/path/to/apikey/file
Li... | 29.126582 | 116 | 0.681008 | #!/usr/bin/env python
"""
Lists key(s) detail(s) visible to the supplied Cosm user API key
To use this script you must create a text file containing your API key
and pass it to this script using the --keyfile argument as follows:
List all keys visible to supplied key:
$ key_view.py --keyfile=/path/to/apikey/file
Li... | 770 | 0 | 22 |
7fe84b3ee1b5f1958f297736edded77c0dfe5000 | 28,059 | py | Python | mmdet/models/backbones/deep_shallow_net.py | ziming-liu/ObjectDet | 6e25fa784114b9773b052d9d5465aa6fed93468a | [
"Apache-2.0"
] | null | null | null | mmdet/models/backbones/deep_shallow_net.py | ziming-liu/ObjectDet | 6e25fa784114b9773b052d9d5465aa6fed93468a | [
"Apache-2.0"
] | null | null | null | mmdet/models/backbones/deep_shallow_net.py | ziming-liu/ObjectDet | 6e25fa784114b9773b052d9d5465aa6fed93468a | [
"Apache-2.0"
] | null | null | null | import logging
import torch
from torch.nn import functional as F
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.runner.checkpoint import open_mmlab_model_urls, load_state_dict
from torch.nn.modules.batchnorm import _BatchNorm
import os
import os.path as osp
import pkgutil
import time
i... | 36.72644 | 112 | 0.536085 | import logging
import torch
from torch.nn import functional as F
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.runner.checkpoint import open_mmlab_model_urls, load_state_dict
from torch.nn.modules.batchnorm import _BatchNorm
import os
import os.path as osp
import pkgutil
import time
i... | 20,077 | 4,701 | 380 |
f6ed54fa8803345e1f0243f96a64d7278490af2f | 520 | py | Python | 2016/day6.py | bloy/adventofcode | 3c98325666f18bfb1af08aac876156e055eed9f6 | [
"MIT"
] | null | null | null | 2016/day6.py | bloy/adventofcode | 3c98325666f18bfb1af08aac876156e055eed9f6 | [
"MIT"
] | 2 | 2019-12-01T15:44:32.000Z | 2019-12-01T15:44:32.000Z | 2016/day6.py | bloy/adventofcode | 3c98325666f18bfb1af08aac876156e055eed9f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import pprint
import collections
if __name__ == '__main__':
with open('day6_input.txt') as f:
data = [line for line in f.read().split("\n") if line != '']
pprint.pprint(solve1(data))
pprint.pprint(solve2(data))
| 23.636364 | 70 | 0.632692 | #!/usr/bin/env python3
import pprint
import collections
def solve1(data):
return "".join([collections.Counter(position).most_common()[0][0]
for position in zip(*data)])
def solve2(data):
return "".join([collections.Counter(position).most_common()[-1][0]
for position in zip(*data)])
... | 215 | 0 | 46 |
37bff107bf700357a12e119952385f7af6502dbe | 203 | py | Python | Python/MEMO.py | neonio/datastructure101 | ab91733fd44b4bb23a10b670e128686ba4366f36 | [
"MIT"
] | null | null | null | Python/MEMO.py | neonio/datastructure101 | ab91733fd44b4bb23a10b670e128686ba4366f36 | [
"MIT"
] | null | null | null | Python/MEMO.py | neonio/datastructure101 | ab91733fd44b4bb23a10b670e128686ba4366f36 | [
"MIT"
] | null | null | null | from typing import NamedTuple, Optional
# =======================
| 14.5 | 39 | 0.605911 | from typing import NamedTuple, Optional
class Response(NamedTuple):
status_code: int
data: str
def request() -> Optional[Response]:
return Response(100, '33')
# =======================
| 46 | 41 | 46 |
a8bac8e3172d4d562a0167d4663f1f6752d89127 | 364 | py | Python | src/oolongt/typings.py | schmamps/textteaser | e948ac6c0a4a4a44c7011206d7df236529d7813d | [
"MIT"
] | 2 | 2020-02-18T09:13:13.000Z | 2021-06-12T13:16:13.000Z | src/oolongt/typings.py | schmamps/textteaser | e948ac6c0a4a4a44c7011206d7df236529d7813d | [
"MIT"
] | null | null | null | src/oolongt/typings.py | schmamps/textteaser | e948ac6c0a4a4a44c7011206d7df236529d7813d | [
"MIT"
] | 1 | 2019-05-05T14:43:53.000Z | 2019-05-05T14:43:53.000Z | """Custom type definitions"""
import pathlib # noqa: F401
import typing
PathOrString = typing.Union[str, pathlib.Path]
OptionalString = typing.Optional[str]
StringList = typing.List[str]
AnyList = typing.List[typing.Any]
OptionalStringList = typing.Union[OptionalString, StringList]
DictOfAny = typing.Dict[str, typing... | 30.333333 | 61 | 0.78022 | """Custom type definitions"""
import pathlib # noqa: F401
import typing
PathOrString = typing.Union[str, pathlib.Path]
OptionalString = typing.Optional[str]
StringList = typing.List[str]
AnyList = typing.List[typing.Any]
OptionalStringList = typing.Union[OptionalString, StringList]
DictOfAny = typing.Dict[str, typing... | 0 | 0 | 0 |
05fd6304e9a7cd3e2f95235e3c2b56d8d155f438 | 1,044 | py | Python | Python/Greedy/135_Candy.py | jq-77/leetcode | a8a10655fe39bc4f4643540f6f0f2ff4208d3529 | [
"MIT"
] | null | null | null | Python/Greedy/135_Candy.py | jq-77/leetcode | a8a10655fe39bc4f4643540f6f0f2ff4208d3529 | [
"MIT"
] | null | null | null | Python/Greedy/135_Candy.py | jq-77/leetcode | a8a10655fe39bc4f4643540f6f0f2ff4208d3529 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 6 16:53:38 2021
@author: keikei
"""
"""
There are n children standing in a line.
Each child is assigned a rating value given in the integer array ratings.
You are giving candies to these children subjected to the following requirements:
Each child must have at least... | 28.216216 | 97 | 0.590038 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 6 16:53:38 2021
@author: keikei
"""
"""
There are n children standing in a line.
Each child is assigned a rating value given in the integer array ratings.
You are giving candies to these children subjected to the following requirements:
Each child must have at least... | 0 | 519 | 23 |
cb282d58203417af2067b2527f6d82b5ba18ff80 | 153 | py | Python | libplf/__init__.py | yyyyyp/libplf | fb73e3c55277e3e94c63e596513b188fedadcf35 | [
"MIT"
] | 2 | 2020-06-10T11:38:50.000Z | 2020-06-11T10:22:39.000Z | libplf/__init__.py | yyyyyp/libplf | fb73e3c55277e3e94c63e596513b188fedadcf35 | [
"MIT"
] | null | null | null | libplf/__init__.py | yyyyyp/libplf | fb73e3c55277e3e94c63e596513b188fedadcf35 | [
"MIT"
] | 3 | 2020-06-11T10:25:02.000Z | 2020-06-12T03:01:34.000Z | from __future__ import annotations
from .vector import T as vector
from .point import T as point
from .piece import T as piece
from .plf import T as plf
| 25.5 | 34 | 0.79085 | from __future__ import annotations
from .vector import T as vector
from .point import T as point
from .piece import T as piece
from .plf import T as plf
| 0 | 0 | 0 |
32e9fc28b63b9d40aed8a6fb8a6ab87a53e9f68f | 32,598 | py | Python | torchvision/edgeailite/xnn/quantize/quant_train_module.py | TexasInstruments/vision | abaf29de0798e8e8d3f996dc272cd3c515562695 | [
"BSD-3-Clause"
] | 21 | 2021-10-08T02:47:56.000Z | 2022-03-29T14:17:04.000Z | torchvision/xnn/quantize/quant_train_module.py | leidi1989/edgeai-torchvision | 94bd2d8a01fac800e7df82dd710b3cc13f9a24ea | [
"BSD-3-Clause"
] | 9 | 2021-11-15T06:43:54.000Z | 2022-03-16T04:47:52.000Z | torchvision/xnn/quantize/quant_train_module.py | leidi1989/edgeai-torchvision | 94bd2d8a01fac800e7df82dd710b3cc13f9a24ea | [
"BSD-3-Clause"
] | 9 | 2021-11-11T11:17:16.000Z | 2022-03-08T04:26:10.000Z | #################################################################################
# Copyright (c) 2018-2021, Texas Instruments Incorporated - http://www.ti.com
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... | 47.106936 | 171 | 0.612676 | #################################################################################
# Copyright (c) 2018-2021, Texas Instruments Incorporated - http://www.ti.com
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... | 28,378 | 1,006 | 519 |
501bd48c3d82345da2589725e6df0df1d4f5fea3 | 5,991 | py | Python | tests/planar_tests/test_multisegment_in_polygon.py | lycantropos/orient | 01f4f67a717c5ee911d83756d455cc35e85ce817 | [
"MIT"
] | 2 | 2020-11-01T00:25:09.000Z | 2021-04-07T10:13:59.000Z | tests/planar_tests/test_multisegment_in_polygon.py | lycantropos/orient | 01f4f67a717c5ee911d83756d455cc35e85ce817 | [
"MIT"
] | null | null | null | tests/planar_tests/test_multisegment_in_polygon.py | lycantropos/orient | 01f4f67a717c5ee911d83756d455cc35e85ce817 | [
"MIT"
] | null | null | null | from typing import Tuple
from ground.base import Relation
from ground.hints import (Multisegment,
Polygon)
from hypothesis import given
from orient.planar import (multisegment_in_polygon,
segment_in_polygon)
from tests.utils import (LINEAR_COMPOUND_RELATIONS,
... | 47.173228 | 79 | 0.644133 | from typing import Tuple
from ground.base import Relation
from ground.hints import (Multisegment,
Polygon)
from hypothesis import given
from orient.planar import (multisegment_in_polygon,
segment_in_polygon)
from tests.utils import (LINEAR_COMPOUND_RELATIONS,
... | 4,754 | 0 | 110 |
87b52778a96116017fba7b57f8e6ffac96f10468 | 2,998 | py | Python | ml_ephys/synthesis/p_synthesize_random_firings.py | ferchaure/ml_ephys | 9fc30d0270a0f98a6ca7c622f7377cd5c6786302 | [
"Apache-2.0"
] | 1 | 2019-03-31T00:30:39.000Z | 2019-03-31T00:30:39.000Z | ml_ephys/synthesis/p_synthesize_random_firings.py | ferchaure/ml_ephys | 9fc30d0270a0f98a6ca7c622f7377cd5c6786302 | [
"Apache-2.0"
] | 10 | 2018-05-05T14:55:01.000Z | 2021-04-15T15:24:06.000Z | ml_ephys/synthesis/p_synthesize_random_firings.py | ferchaure/ml_ephys | 9fc30d0270a0f98a6ca7c622f7377cd5c6786302 | [
"Apache-2.0"
] | 6 | 2018-07-05T20:06:30.000Z | 2020-11-27T12:19:03.000Z | import numpy as np
from mountainlab_pytools import mdaio
processor_name='ephys.synthesize_random_firings'
processor_version='0.14'
def synthesize_random_firings(*,firings_out,K=20,samplerate=30000,duration=60):
"""
Synthesize random waveforms for use in creating a synthetic timeseries dataset
Parameters
... | 31.893617 | 133 | 0.672448 | import numpy as np
from mountainlab_pytools import mdaio
processor_name='ephys.synthesize_random_firings'
processor_version='0.14'
def synthesize_random_firings(*,firings_out,K=20,samplerate=30000,duration=60):
"""
Synthesize random waveforms for use in creating a synthetic timeseries dataset
Parameters
... | 859 | 0 | 85 |
73a132aea6d1ad29dc0db783095d9d49ff26ff2f | 6,149 | py | Python | utils/noise.py | jcaw/talon_conf | a1c2a02e2a7b2d37b6bd40aa5ce3b334206460c2 | [
"MIT"
] | 9 | 2020-05-13T19:41:54.000Z | 2022-02-04T06:18:21.000Z | utils/noise.py | jcaw/talon_conf | a1c2a02e2a7b2d37b6bd40aa5ce3b334206460c2 | [
"MIT"
] | null | null | null | utils/noise.py | jcaw/talon_conf | a1c2a02e2a7b2d37b6bd40aa5ce3b334206460c2 | [
"MIT"
] | 2 | 2020-06-06T15:10:58.000Z | 2022-02-04T06:18:01.000Z | import threading
import logging
import inspect
from talon import cron, noise, Context
from user.utils import context_active
class _HandlerMapper(object):
"""Maps contexts to custom handlers.
Workaround for contexts being unable to be added directly.
"""
def add(self, context, handler, priority=0)... | 34.740113 | 88 | 0.629696 | import threading
import logging
import inspect
from talon import cron, noise, Context
from user.utils import context_active
class _LongNoiseHandler(object):
def __init__(self, handler, gap_tolerance=0):
# Check now to prevent deferred errors.
self._assert_context_manager(handler)
assert i... | 2,715 | 163 | 212 |
3b1ca24788eea5857eb0b94da235d619d1fc5412 | 252 | py | Python | locale/pot/api/core/_autosummary/pyvista-DataSetFilters-surface_indices-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 4 | 2020-08-07T08:19:19.000Z | 2020-12-04T09:51:11.000Z | locale/pot/api/core/_autosummary/pyvista-UnstructuredGrid-surface_indices-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 19 | 2020-08-06T00:24:30.000Z | 2022-03-30T19:22:24.000Z | locale/pot/api/core/_autosummary/pyvista-RectilinearGrid-surface_indices-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 1 | 2021-03-09T07:50:40.000Z | 2021-03-09T07:50:40.000Z | # Return the first 10 surface indices of an UnstructuredGrid.
#
from pyvista import examples
grid = examples.load_hexbeam()
ind = grid.surface_indices()
ind[:10] # doctest:+SKIP
# Expected:
## pyvista_ndarray([ 0, 2, 36, 27, 7, 8, 81, 1, 18, 4])
| 28 | 61 | 0.690476 | # Return the first 10 surface indices of an UnstructuredGrid.
#
from pyvista import examples
grid = examples.load_hexbeam()
ind = grid.surface_indices()
ind[:10] # doctest:+SKIP
# Expected:
## pyvista_ndarray([ 0, 2, 36, 27, 7, 8, 81, 1, 18, 4])
| 0 | 0 | 0 |
a1c20e3fdc8d400887df4e27dd4ac5a52a552c36 | 271 | py | Python | app/temperatures/forms.py | swelanauguste/comptechs-1.1 | 5da6975a1eb93ed39fb2467e5c1cd702fe5917c5 | [
"MIT"
] | null | null | null | app/temperatures/forms.py | swelanauguste/comptechs-1.1 | 5da6975a1eb93ed39fb2467e5c1cd702fe5917c5 | [
"MIT"
] | null | null | null | app/temperatures/forms.py | swelanauguste/comptechs-1.1 | 5da6975a1eb93ed39fb2467e5c1cd702fe5917c5 | [
"MIT"
] | null | null | null | from django import forms
from .models import Temperature
class TemperatureCreateForm(forms.ModelForm):
"""
Temperature create form
"""
| 16.9375 | 47 | 0.642066 | from django import forms
from .models import Temperature
class TemperatureCreateForm(forms.ModelForm):
"""
Temperature create form
"""
class Meta:
model = Temperature
fields = "__all__"
exclude = ("created_by", "updated_by",)
| 0 | 93 | 27 |
ebf3343663f678b01dee5e92764db235064e9d20 | 670 | py | Python | lane/test.py | KITTCAMP-CODE/puppy | f222c935ee474eb6e9dec2ff60f05415eab34c90 | [
"Apache-2.0"
] | 2 | 2018-12-23T06:47:18.000Z | 2019-07-22T16:42:09.000Z | lane/test.py | KITTCAMP-CODE/puppy | f222c935ee474eb6e9dec2ff60f05415eab34c90 | [
"Apache-2.0"
] | null | null | null | lane/test.py | KITTCAMP-CODE/puppy | f222c935ee474eb6e9dec2ff60f05415eab34c90 | [
"Apache-2.0"
] | null | null | null | import cv2
import urllib2
import numpy as np
import sys
host = "192.168.1.85:8080"
if len(sys.argv)>1:
host = sys.argv[1]
hoststr = 'http://' + host + '/?action=stream'
print 'Streaming ' + hoststr
print 'Print Esc to quit'
stream=urllib2.urlopen(hoststr)
bytes=''
while True:
bytes+=stream.read(1024)
a = b... | 25.769231 | 68 | 0.585075 | import cv2
import urllib2
import numpy as np
import sys
host = "192.168.1.85:8080"
if len(sys.argv)>1:
host = sys.argv[1]
hoststr = 'http://' + host + '/?action=stream'
print 'Streaming ' + hoststr
print 'Print Esc to quit'
stream=urllib2.urlopen(hoststr)
bytes=''
while True:
bytes+=stream.read(1024)
a = b... | 0 | 0 | 0 |
bf1a61c96750e2fa06a9e8b98caf15fcd750196f | 415 | py | Python | CCC/ccc05s2.py | devAdhiraj/coding-problems | e15d0eeb025e1ad503c73eb9280e6226fd979164 | [
"MIT"
] | null | null | null | CCC/ccc05s2.py | devAdhiraj/coding-problems | e15d0eeb025e1ad503c73eb9280e6226fd979164 | [
"MIT"
] | null | null | null | CCC/ccc05s2.py | devAdhiraj/coding-problems | e15d0eeb025e1ad503c73eb9280e6226fd979164 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
xmax, ymax = list(map(int, input().split()))
x, y = list(map(int, input().split()))
posx, posy = 0, 0
while(x != 0 or y != 0):
posx += x
posy += y
if posx < 0:
posx = 0
if posx > xmax:
posx = xmax
if posy < 0:
posy = 0
if posy > ... | 17.291667 | 44 | 0.496386 | import sys
input = sys.stdin.readline
xmax, ymax = list(map(int, input().split()))
x, y = list(map(int, input().split()))
posx, posy = 0, 0
while(x != 0 or y != 0):
posx += x
posy += y
if posx < 0:
posx = 0
if posx > xmax:
posx = xmax
if posy < 0:
posy = 0
if posy > ... | 0 | 0 | 0 |
66ad69d9def08bbec4328a2fede290c1141f6585 | 51,895 | py | Python | twext/enterprise/test/test_adbapi2.py | troglodyne/ccs-twistedextensions | 1b43cb081ba68ae310140a9e853e041cd6362625 | [
"Apache-2.0"
] | 23 | 2016-08-14T07:20:27.000Z | 2021-11-08T09:47:45.000Z | twext/enterprise/test/test_adbapi2.py | DalavanCloud/ccs-twistedextensions | 2c4046df88873dcf33fba7840ed90e4238dcbec7 | [
"Apache-2.0"
] | 2 | 2016-12-15T17:51:49.000Z | 2019-05-12T15:59:03.000Z | twext/enterprise/test/test_adbapi2.py | DalavanCloud/ccs-twistedextensions | 2c4046df88873dcf33fba7840ed90e4238dcbec7 | [
"Apache-2.0"
] | 20 | 2016-08-17T06:51:00.000Z | 2022-03-26T11:55:56.000Z | ##
# Copyright (c) 2010-2017 Apple Inc. 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... | 37.990483 | 93 | 0.639946 | ##
# Copyright (c) 2010-2017 Apple Inc. 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,421 | 0 | 412 |
0965bf852b0d00ebe28a092b4afc344b9c80e778 | 359 | py | Python | src/solver-server/pkg/algorithms/identifiability/methods.py | Rhymmor/pharmac | 88ca6d1388623d60769f578fc1c019288eeb8ddc | [
"MIT"
] | 3 | 2017-11-17T21:04:10.000Z | 2018-05-20T09:29:40.000Z | src/solver-server/pkg/algorithms/identifiability/methods.py | Rhymmor/pharmac | 88ca6d1388623d60769f578fc1c019288eeb8ddc | [
"MIT"
] | null | null | null | src/solver-server/pkg/algorithms/identifiability/methods.py | Rhymmor/pharmac | 88ca6d1388623d60769f578fc1c019288eeb8ddc | [
"MIT"
] | 1 | 2017-09-29T05:23:34.000Z | 2017-09-29T05:23:34.000Z | from .sensitivity import solve_sensitivity
from .monte_carlo import solve_monte_carlo
from ..model_parser import ModelParser | 32.636364 | 52 | 0.749304 | from .sensitivity import solve_sensitivity
from .monte_carlo import solve_monte_carlo
from ..model_parser import ModelParser
def solve_identifiability(model):
method = model['options']['method']
if method == 'sensitivity':
return solve_sensitivity(model, ModelParser)
elif method == 'monte_carlo':
... | 211 | 0 | 23 |