hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7fb75ee533a5364bc88e6a20902d87f866ac6ba | 1,456 | py | Python | datasets.py | bartwojcik/cifar-template | c603d9120f54619863b7418574158572c2d5f659 | [
"MIT"
] | null | null | null | datasets.py | bartwojcik/cifar-template | c603d9120f54619863b7418574158572c2d5f659 | [
"MIT"
] | null | null | null | datasets.py | bartwojcik/cifar-template | c603d9120f54619863b7418574158572c2d5f659 | [
"MIT"
] | null | null | null | from torchvision import datasets, transforms
def get_mnist(dataset_path):
path_str = str(dataset_path.resolve())
transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize(mean=(0.5, ), std=(0.5, )),
])
train_data = datasets.MNIST(path_str, train=True, download=True, ... | 40.444444 | 101 | 0.699863 | from torchvision import datasets, transforms
def get_mnist(dataset_path):
path_str = str(dataset_path.resolve())
transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize(mean=(0.5, ), std=(0.5, )),
])
train_data = datasets.MNIST(path_str, train=True, download=True, ... | true | true |
f7fb778e596b28cd0f529e0a5ff7b9e43b561a3c | 1,331 | py | Python | brian2/tests/features/monitors.py | CharleeSF/brian2 | d2be1ed33a8ac51b1891f89a2544123a937c43ff | [
"BSD-2-Clause"
] | 2 | 2020-03-20T13:30:19.000Z | 2020-03-20T13:30:57.000Z | brian2/tests/features/monitors.py | CharleeSF/brian2 | d2be1ed33a8ac51b1891f89a2544123a937c43ff | [
"BSD-2-Clause"
] | 13 | 2015-10-05T15:33:42.000Z | 2015-11-18T08:31:42.000Z | brian2/tests/features/monitors.py | moritzaugustin/brian2 | d98ea0cb4af0c9426e71c8ee7659ddb13aea8593 | [
"BSD-2-Clause"
] | null | null | null | '''
Check that various monitors work correctly.
'''
from brian2 import *
from brian2.tests.features import FeatureTest, InaccuracyError
class SpikeMonitorTest(FeatureTest):
category = "Monitors"
name = "SpikeMonitor"
tags = ["NeuronGroup", "run",
"SpikeMonitor"]
def run(self):
... | 22.948276 | 72 | 0.500376 |
from brian2 import *
from brian2.tests.features import FeatureTest, InaccuracyError
class SpikeMonitorTest(FeatureTest):
category = "Monitors"
name = "SpikeMonitor"
tags = ["NeuronGroup", "run",
"SpikeMonitor"]
def run(self):
N = 100
tau = 10*ms
eqs = '''... | true | true |
f7fb78784a38735392a7ce30348e004c69d74ceb | 19,826 | py | Python | uproot4/source/http.py | tamasgal/uproot4 | c94fc036b8e8f35a36478a358203029224654606 | [
"BSD-3-Clause"
] | null | null | null | uproot4/source/http.py | tamasgal/uproot4 | c94fc036b8e8f35a36478a358203029224654606 | [
"BSD-3-Clause"
] | null | null | null | uproot4/source/http.py | tamasgal/uproot4 | c94fc036b8e8f35a36478a358203029224654606 | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/master/LICENSE
"""
Physical layer for remote files, accessed via HTTP(S).
Defines a :py:class:`~uproot4.source.http.HTTPResource` (stateless) and two sources:
:py:class:`~uproot4.source.http.MultithreadedHTTPSource` and
:py:class:`~uproot4.source.... | 34.006861 | 131 | 0.600222 |
from __future__ import absolute_import
import sys
import re
try:
from http.client import HTTPConnection
from http.client import HTTPSConnection
from urllib.parse import urlparse
except ImportError:
from httplib import HTTPConnection
from httplib import HTTPSConnection
from urlparse import u... | true | true |
f7fb7964179468eaa79b757cd24bf19739e8243d | 7,150 | py | Python | problog/test/test_lfi.py | jselvam11/problog | 35d92989b7b49591963d5076ac5307613ebdf99e | [
"Apache-2.0"
] | 1 | 2021-09-23T11:50:44.000Z | 2021-09-23T11:50:44.000Z | problog/test/test_lfi.py | thuwzy/problog | 35d92989b7b49591963d5076ac5307613ebdf99e | [
"Apache-2.0"
] | null | null | null | problog/test/test_lfi.py | thuwzy/problog | 35d92989b7b49591963d5076ac5307613ebdf99e | [
"Apache-2.0"
] | null | null | null | """
Module name
"""
from __future__ import print_function
from problog import root_path
from problog.util import subprocess_call, subprocess_check_output
import unittest
import os
import sys
import glob
import subprocess, traceback
from problog.learning.lfi import lfi_wrapper, LFIProblem
if __name__ == "__main__":
... | 36.294416 | 98 | 0.54951 |
from __future__ import print_function
from problog import root_path
from problog.util import subprocess_call, subprocess_check_output
import unittest
import os
import sys
import glob
import subprocess, traceback
from problog.learning.lfi import lfi_wrapper, LFIProblem
if __name__ == "__main__":
sys.path.insert(
... | true | true |
f7fb7ab1cf810c21bbb095e32187edc28ef8e24e | 12,750 | py | Python | tests/test_device_services.py | deichmab-draeger/sdc11073-1 | 2cbd4daaa32dc8a52723ecb8209f39a7d19b3c1b | [
"MIT"
] | null | null | null | tests/test_device_services.py | deichmab-draeger/sdc11073-1 | 2cbd4daaa32dc8a52723ecb8209f39a7d19b3c1b | [
"MIT"
] | null | null | null | tests/test_device_services.py | deichmab-draeger/sdc11073-1 | 2cbd4daaa32dc8a52723ecb8209f39a7d19b3c1b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
import os
import uuid
from lxml import etree as etree_
import logging
import logging.handlers
from sdc11073.wsdiscovery import WSDiscoveryWhitelist
from sdc11073.location import SdcLocation
from sdc11073.namespaces import msgTag, domTag, nsmap
from sdc11073.namespaces i... | 49.418605 | 152 | 0.634353 |
import unittest
import os
import uuid
from lxml import etree as etree_
import logging
import logging.handlers
from sdc11073.wsdiscovery import WSDiscoveryWhitelist
from sdc11073.location import SdcLocation
from sdc11073.namespaces import msgTag, domTag, nsmap
from sdc11073.namespaces import Prefix_Namespace a... | true | true |
f7fb7cbb7cdf542974c4decb099b005b376b41fe | 1,296 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/RunExecutionPlanRequest.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/RunExecutionPlanRequest.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/RunExecutionPlanRequest.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | 1 | 2021-01-26T05:01:42.000Z | 2021-01-26T05:01:42.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 u... | 36 | 69 | 0.76466 |
from aliyunsdkcore.request import RpcRequest
class RunExecutionPlanRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Emr', '2016-04-08', 'RunExecutionPlan')
def get_ResourceOwnerId(self):
return self.get_query_params().get('ResourceOwnerId')
def set_ResourceOwnerId(se... | true | true |
f7fb7ce58aeccb0059790a80d8d9416427e25e58 | 1,438 | py | Python | pharmrep/reports/views.py | boyombo/pharmrep | 2293ceb235dec949c58fa40d1ee43fce172e0ceb | [
"MIT"
] | null | null | null | pharmrep/reports/views.py | boyombo/pharmrep | 2293ceb235dec949c58fa40d1ee43fce172e0ceb | [
"MIT"
] | null | null | null | pharmrep/reports/views.py | boyombo/pharmrep | 2293ceb235dec949c58fa40d1ee43fce172e0ceb | [
"MIT"
] | null | null | null | from django.shortcuts import render
#from django.db.models.aggregates import Sum
from product.models import Customer, Product, Payment, Rep
from core.views import BaseActivityListView
def last_activity(request):
return render(request, 'reports/last_activity.html',
{'reps': Rep.objects.all()})
... | 33.44186 | 73 | 0.691933 | from django.shortcuts import render
from product.models import Customer, Product, Payment, Rep
from core.views import BaseActivityListView
def last_activity(request):
return render(request, 'reports/last_activity.html',
{'reps': Rep.objects.all()})
def balance(request):
return render(req... | true | true |
f7fb7d3f66ec949e8d72964f2c7bc87a4bdffefe | 475 | py | Python | wafw00f/plugins/secureiis.py | biscuitehh/wafw00f | b1a08122ea3d65e2aaaa5120231cca6c37851c5b | [
"BSD-3-Clause"
] | 1 | 2020-01-17T08:09:48.000Z | 2020-01-17T08:09:48.000Z | wafw00f/plugins/secureiis.py | tlsloves/wafw00f | 9682cdbdffc78150719b58390f8c5552b40a40b6 | [
"BSD-3-Clause"
] | null | null | null | wafw00f/plugins/secureiis.py | tlsloves/wafw00f | 9682cdbdffc78150719b58390f8c5552b40a40b6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
'''
Copyright (C) 2019, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'eEye SecureIIS (BeyondTrust)'
def is_waf(self):
schemes = [
self.matchContent(r'SecureIIS is an internet security application'),
self.matchContent(r'Download SecureIIS Person... | 26.388889 | 76 | 0.669474 |
NAME = 'eEye SecureIIS (BeyondTrust)'
def is_waf(self):
schemes = [
self.matchContent(r'SecureIIS is an internet security application'),
self.matchContent(r'Download SecureIIS Personal Edition'),
self.matchContent(r'https?://www\.eeye\.com/Secure\-?IIS')
]
if any(i for i in schem... | true | true |
f7fb7dbcb17db3de7c0030cf3949e04eeea2df2d | 10,102 | py | Python | gluoncv/model_zoo/model_zoo.py | DetectionTeamUCAS/FCOS_GluonCV | 7d032c43bdeb748236d9f46043794eaa97bf3f1b | [
"Apache-2.0"
] | 28 | 2019-05-08T04:52:28.000Z | 2020-04-12T07:22:53.000Z | gluoncv/model_zoo/model_zoo.py | DetectionTeamUCAS/FCOS_GluonCV | 7d032c43bdeb748236d9f46043794eaa97bf3f1b | [
"Apache-2.0"
] | 2 | 2019-05-13T01:46:39.000Z | 2019-05-20T08:04:36.000Z | gluoncv/model_zoo/model_zoo.py | DetectionTeamUCAS/FCOS_GluonCV | 7d032c43bdeb748236d9f46043794eaa97bf3f1b | [
"Apache-2.0"
] | 2 | 2020-07-14T14:50:18.000Z | 2022-01-27T07:07:41.000Z | # pylint: disable=wildcard-import, unused-wildcard-import
"""Model store which handles pretrained models from both
mxnet.gluon.model_zoo.vision and gluoncv.models
"""
from .alexnet import *
from .cifarresnet import *
from .cifarresnext import *
from .cifarwideresnet import *
from .deeplabv3 import *
from .densenet impo... | 40.408 | 88 | 0.763017 |
from .alexnet import *
from .cifarresnet import *
from .cifarresnext import *
from .cifarwideresnet import *
from .deeplabv3 import *
from .densenet import *
from .faster_rcnn import *
from .fcn import *
from .inception import *
from .mask_rcnn import *
from .mobilenet import *
from .nasnet import *
from .pruned_resne... | true | true |
f7fb7e941bb5541cd9711a61fceff96a5672ae33 | 1,713 | py | Python | src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource.py | tilnl/azure-cli-extensions | ef9946bbcde34bb51343554a8f2a8dedd1f7d44a | [
"MIT"
] | null | null | null | src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource.py | tilnl/azure-cli-extensions | ef9946bbcde34bb51343554a8f2a8dedd1f7d44a | [
"MIT"
] | null | null | null | src/codespaces/azext_codespaces/vendored_sdks/vsonline/models/resource.py | tilnl/azure-cli-extensions | ef9946bbcde34bb51343554a8f2a8dedd1f7d44a | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 31.722222 | 76 | 0.553999 |
from msrest.serialization import Model
class Resource(Model):
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str... | true | true |
f7fb7ff02e1360a4e40c3a6bf1888be3e22bc26d | 875 | py | Python | dJango/detect0/qa.py | GursimranSinghKahlon/EdTech | 5944019ccb3d054dbb1f8eb8a81363cb7bae9de6 | [
"MIT"
] | 1 | 2019-05-25T04:22:00.000Z | 2019-05-25T04:22:00.000Z | dJango/detect0/qa.py | GursimranSinghKahlon/EdTech | 5944019ccb3d054dbb1f8eb8a81363cb7bae9de6 | [
"MIT"
] | null | null | null | dJango/detect0/qa.py | GursimranSinghKahlon/EdTech | 5944019ccb3d054dbb1f8eb8a81363cb7bae9de6 | [
"MIT"
] | null | null | null |
def loadModel():
import pickle
filename = 'finalized_model.sav'
pickle.dump(modelLR, open(filename, 'wb'))
# load the model from disk
loaded_model = pickle.load(open(filename, 'rb'))
return loaded_model
q1 = "what is computer?"
q2 = "what are advantage of computer?"
def predictOutput(q1,q2):
model =... | 19.444444 | 78 | 0.609143 |
def loadModel():
import pickle
filename = 'finalized_model.sav'
pickle.dump(modelLR, open(filename, 'wb'))
loaded_model = pickle.load(open(filename, 'rb'))
return loaded_model
q1 = "what is computer?"
q2 = "what are advantage of computer?"
def predictOutput(q1,q2):
model = loadModel()
q=[q1,q... | false | true |
f7fb8005bb19d399b2dbe1441873e118df38dd73 | 127 | py | Python | utils/__init__.py | cmiras/BSL-segmentation | 35a66d6c758dcf4734adb0ebc5a40ea7238d7a1d | [
"MIT"
] | 17 | 2021-06-08T07:53:36.000Z | 2022-03-27T02:57:50.000Z | utils/__init__.py | cmiras/BSL-segmentation | 35a66d6c758dcf4734adb0ebc5a40ea7238d7a1d | [
"MIT"
] | 5 | 2021-07-15T09:41:08.000Z | 2022-01-13T14:53:10.000Z | utils/__init__.py | cmiras/BSL-segmentation | 35a66d6c758dcf4734adb0ebc5a40ea7238d7a1d | [
"MIT"
] | 18 | 2021-06-08T15:22:09.000Z | 2022-02-21T19:06:52.000Z |
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "progress"))
from progress.bar import Bar as Bar | 21.166667 | 68 | 0.771654 |
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "progress"))
from progress.bar import Bar as Bar | true | true |
f7fb8103640c452dd3046356dbdbd1def614e983 | 373 | py | Python | cadastro_login/forms.py | alyneperez/cadastro_login | 1b59d5e8df9e080590f84d073e7645df971b7f95 | [
"MIT"
] | 2 | 2021-09-28T19:54:26.000Z | 2021-09-29T21:47:31.000Z | cadastro_login/forms.py | alyneperez/cadastro_login | 1b59d5e8df9e080590f84d073e7645df971b7f95 | [
"MIT"
] | null | null | null | cadastro_login/forms.py | alyneperez/cadastro_login | 1b59d5e8df9e080590f84d073e7645df971b7f95 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, HiddenField
from wtforms.validators import DataRequired, Email
class LoginForm(FlaskForm):
username = StringField("username" , validators=[DataRequired()])
password = PasswordField("password" , validators=[DataRequir... | 37.3 | 73 | 0.785523 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, HiddenField
from wtforms.validators import DataRequired, Email
class LoginForm(FlaskForm):
username = StringField("username" , validators=[DataRequired()])
password = PasswordField("password" , validators=[DataRequir... | true | true |
f7fb8114c6de81e9e8e52c2ebf15cb32444aad14 | 481 | py | Python | folders/chat/client/test.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | 1 | 2020-10-06T01:20:07.000Z | 2020-10-06T01:20:07.000Z | folders/chat/client/test.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | folders/chat/client/test.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | from client import Client
import time
from threading import Thread
b1 = input("enter your name ")
c1 = Client(b1)
def update():
msgs = []
run = True
while run:
time.sleep(0.2)
new_messages = c1.get()
msgs.extend(new_messages)
for msg in new_messages:
print(msg)... | 17.178571 | 33 | 0.544699 | from client import Client
import time
from threading import Thread
b1 = input("enter your name ")
c1 = Client(b1)
def update():
msgs = []
run = True
while run:
time.sleep(0.2)
new_messages = c1.get()
msgs.extend(new_messages)
for msg in new_messages:
print(msg)... | true | true |
f7fb81ed21611fa63452000da08ce4f754f7e085 | 495 | py | Python | threaded_reader.py | vlaznev/SerialPlotter | 758ba1a5af9b30a53d7d40aedd540bf39441ac0f | [
"MIT"
] | 1 | 2019-04-20T00:56:57.000Z | 2019-04-20T00:56:57.000Z | threaded_reader.py | vlaznev/SerialPlotter | 758ba1a5af9b30a53d7d40aedd540bf39441ac0f | [
"MIT"
] | null | null | null | threaded_reader.py | vlaznev/SerialPlotter | 758ba1a5af9b30a53d7d40aedd540bf39441ac0f | [
"MIT"
] | null | null | null | from Queue import Queue
import threading
class ThreadedReader:
def __init__(self, file, startImmediately=True):
self.queue = Queue()
self.file = file
self.thread = None
if startImmediately:
self.start()
def next(self):
return None if self.queue.empty() else self.queue.get()
def thread_loop(self):
f... | 21.521739 | 59 | 0.721212 | from Queue import Queue
import threading
class ThreadedReader:
def __init__(self, file, startImmediately=True):
self.queue = Queue()
self.file = file
self.thread = None
if startImmediately:
self.start()
def next(self):
return None if self.queue.empty() else self.queue.get()
def thread_loop(self):
f... | true | true |
f7fb8217a9ba82eb79640006aba8a3e3dfb8a28b | 22,766 | py | Python | django/db/backends/mysql/base.py | dolfly/django | a971d19bab9bfc33d301669b319b4766bf6d94f6 | [
"BSD-3-Clause"
] | null | null | null | django/db/backends/mysql/base.py | dolfly/django | a971d19bab9bfc33d301669b319b4766bf6d94f6 | [
"BSD-3-Clause"
] | null | null | null | django/db/backends/mysql/base.py | dolfly/django | a971d19bab9bfc33d301669b319b4766bf6d94f6 | [
"BSD-3-Clause"
] | null | null | null | """
MySQL database backend for Django.
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigur... | 41.317604 | 120 | 0.650663 | from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
# lexicographic ordering in thi... | true | true |
f7fb8227f80fc3a082c5948a8aaf08a803d07707 | 528 | py | Python | face_detect/sample/learning_opencv3_with_python_sample/Chapter 6_Code/brief.py | minatuyang/RASP-ATTA | e182248da2f9f131e4e1aca5a2198b6ae910424e | [
"MIT"
] | 1 | 2018-11-14T02:54:24.000Z | 2018-11-14T02:54:24.000Z | face_detect/sample/learning_opencv3_with_python_sample/Chapter 6_Code/brief.py | minatuyang/RASP-ATTA | e182248da2f9f131e4e1aca5a2198b6ae910424e | [
"MIT"
] | null | null | null | face_detect/sample/learning_opencv3_with_python_sample/Chapter 6_Code/brief.py | minatuyang/RASP-ATTA | e182248da2f9f131e4e1aca5a2198b6ae910424e | [
"MIT"
] | null | null | null | import numpy as np
import cv2
from matplotlib import pyplot as plt
"""FeatureDetector_create and DescriptorExtractor_create do not exists in 3.0.0-rc1"""
img = cv2.imread('images/coat_of_arms_single.jpg',0)
# Initiate STAR detector
star = cv2.FeatureDetector_create("STAR")
# Initiate BRIEF extractor
brief = cv2.Des... | 22.956522 | 86 | 0.774621 | import numpy as np
import cv2
from matplotlib import pyplot as plt
"""FeatureDetector_create and DescriptorExtractor_create do not exists in 3.0.0-rc1"""
img = cv2.imread('images/coat_of_arms_single.jpg',0)
star = cv2.FeatureDetector_create("STAR")
brief = cv2.DescriptorExtractor_create("BRIEF")
kp = star.detec... | false | true |
f7fb82465e215c5a4d9e443f86b84e3a95dc0d61 | 3,900 | py | Python | cupy/_core/__init__.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | null | null | null | cupy/_core/__init__.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | null | null | null | cupy/_core/__init__.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | null | null | null | from cupy._core import core # NOQA
from cupy._core import fusion # NOQA
from cupy._core import internal # NOQA
# internal APIs for testing and developement
from cupy._core._accelerator import set_reduction_accelerators # NOQA
from cupy._core._accelerator import set_routine_accelerators # NOQA
from cupy._core._ac... | 52 | 72 | 0.821538 | from cupy._core import core
from cupy._core import fusion
from cupy._core import internal
from cupy._core._accelerator import set_reduction_accelerators
from cupy._core._accelerator import set_routine_accelerators
from cupy._core._accelerator import get_reduction_accelerators
from cupy._core._accelerator... | true | true |
f7fb82c079a5dc8f4b64c83bc2b5743d67714eb1 | 4,573 | py | Python | riptide/tests/integration/testcase_engine.py | theCapypara/riptide-lib | 560106d4196cdc5a5b84235f32ac44c80bc3994e | [
"MIT"
] | 4 | 2019-04-23T17:14:00.000Z | 2019-12-22T11:55:31.000Z | riptide/tests/integration/testcase_engine.py | theCapypara/riptide-lib | 560106d4196cdc5a5b84235f32ac44c80bc3994e | [
"MIT"
] | 15 | 2021-09-22T09:40:42.000Z | 2022-03-07T05:01:07.000Z | riptide/tests/integration/testcase_engine.py | theCapypara/riptide-lib | 560106d4196cdc5a5b84235f32ac44c80bc3994e | [
"MIT"
] | 1 | 2019-11-24T18:08:14.000Z | 2019-11-24T18:08:14.000Z | import asyncio
import unittest
import requests
from typing import re, Union, AnyStr, Pattern
from urllib import request
class EngineTest(unittest.TestCase):
def run_start_test(self, engine, project, services, engine_tester):
# Run async test code
loop = asyncio.get_event_loop()
loop.run_... | 47.635417 | 114 | 0.645309 | import asyncio
import unittest
import requests
from typing import re, Union, AnyStr, Pattern
from urllib import request
class EngineTest(unittest.TestCase):
def run_start_test(self, engine, project, services, engine_tester):
loop = asyncio.get_event_loop()
loop.run_until_complete(self._... | true | true |
f7fb8302e0952238b808eb1d98c853e1f04ba2ca | 7,214 | py | Python | examples/optimization/layout_opt/hybrid_run.py | Matthew-Boyd/HOPP | de4e40efda5bfb28361dc3d9d68d13aa465dcc52 | [
"BSD-3-Clause"
] | null | null | null | examples/optimization/layout_opt/hybrid_run.py | Matthew-Boyd/HOPP | de4e40efda5bfb28361dc3d9d68d13aa465dcc52 | [
"BSD-3-Clause"
] | null | null | null | examples/optimization/layout_opt/hybrid_run.py | Matthew-Boyd/HOPP | de4e40efda5bfb28361dc3d9d68d13aa465dcc52 | [
"BSD-3-Clause"
] | null | null | null | """
A prototype application of the distributed cross-entropy method to the wind optimization problem.
In this basic implementation, the number of turbines is fixed and the generative distribution is uncorrelated.
TODO:
+ Add boundary constraints / penalties
+ Add proximity constraints
+ Better order turbine locatio... | 34.352381 | 111 | 0.659689 |
import matplotlib as mpl
mpl.use('Agg')
import os
from dotenv import load_dotenv
import numpy as np
from matplotlib.animation import (
PillowWriter,
)
from matplotlib.lines import Line2D
from tools.optimization import (
setup_run,
DataRecorder
)
from hybrid.sites import make_circular_site, make... | true | true |
f7fb8354bcbce6b0b82cf820584c5ff4d9710fe0 | 1,838 | py | Python | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/file_server_location_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-06-02T08:01:35.000Z | 2021-06-02T08:01:35.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/file_server_location_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2020-03-06T05:57:16.000Z | 2020-03-06T05:57:16.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/file_server_location_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 39.956522 | 160 | 0.642002 |
from .dataset_location_py3 import DatasetLocation
class FileServerLocation(DatasetLocation):
_validation = {
'type': {'required': True},
}
_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'type': {'key': 'type', 'type': 'str'},
'fold... | true | true |
f7fb83b3bf0ea0e468a7eaf0fc266fc06350eeb9 | 3,436 | py | Python | cupyimg/version.py | haesleinhuepf/cupyimg | 1fbe5d5ed53a030eb0dfbf618a0b194af1cac2ae | [
"BSD-3-Clause"
] | 39 | 2020-03-28T14:36:45.000Z | 2022-02-26T20:39:24.000Z | cupyimg/version.py | haesleinhuepf/cupyimg | 1fbe5d5ed53a030eb0dfbf618a0b194af1cac2ae | [
"BSD-3-Clause"
] | 10 | 2020-09-02T18:19:37.000Z | 2022-03-11T08:48:29.000Z | cupyimg/version.py | haesleinhuepf/cupyimg | 1fbe5d5ed53a030eb0dfbf618a0b194af1cac2ae | [
"BSD-3-Clause"
] | 4 | 2020-04-13T21:24:14.000Z | 2021-06-17T18:07:22.000Z | from os.path import join as pjoin
# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 0
_version_minor = 1
_version_micro = "" # use "" for first of series, number for 1 and above
_version_extra = "dev0"
# _version_extra = "" # Uncomment this for full releases
# Construct f... | 33.359223 | 79 | 0.686554 | from os.path import join as pjoin
_version_major = 0
_version_minor = 1
_version_micro = ""
_version_extra = "dev0"
n_minor]
if _version_micro:
_ver.append(_version_micro)
if _version_extra:
_ver.append(_version_extra)
__version__ = ".".join(map(str, _ver))
CLASSIFIERS = [
"Development Status :: 4 - B... | true | true |
f7fb842514fa110335d5a59b7f8680010eb0cdef | 1,352 | py | Python | nilearn/tests/test_testing.py | agramfort/nilearn | f075440e6d97b5bf359bb25e9197dbcbbc26e5f2 | [
"BSD-2-Clause"
] | 1 | 2020-12-20T00:22:14.000Z | 2020-12-20T00:22:14.000Z | nilearn/tests/test_testing.py | agramfort/nilearn | f075440e6d97b5bf359bb25e9197dbcbbc26e5f2 | [
"BSD-2-Clause"
] | 3 | 2016-02-23T09:47:05.000Z | 2018-10-12T16:54:38.000Z | nilearn/tests/test_testing.py | agramfort/nilearn | f075440e6d97b5bf359bb25e9197dbcbbc26e5f2 | [
"BSD-2-Clause"
] | 3 | 2017-01-06T09:54:00.000Z | 2020-02-17T12:57:35.000Z | import itertools
import numpy as np
from nose.tools import assert_equal, assert_raises
from nilearn._utils.testing import generate_fake_fmri
def test_generate_fake_fmri():
shapes = [(6, 6, 7), (10, 11, 12)]
lengths = [16, 20]
kinds = ['noise', 'step']
n_blocks = [None, 1, 4]
block_size = [None,... | 30.727273 | 73 | 0.611686 | import itertools
import numpy as np
from nose.tools import assert_equal, assert_raises
from nilearn._utils.testing import generate_fake_fmri
def test_generate_fake_fmri():
shapes = [(6, 6, 7), (10, 11, 12)]
lengths = [16, 20]
kinds = ['noise', 'step']
n_blocks = [None, 1, 4]
block_size = [None,... | true | true |
f7fb84ff9e639e6e038d329eec5eb7f65a8d7883 | 1,718 | py | Python | tekstovni_vmesnik.py | milaneztim/Racunanje-z-matrikami | 2803f936dc67db1ec308cc1e9be35f434e4b58ef | [
"MIT"
] | null | null | null | tekstovni_vmesnik.py | milaneztim/Racunanje-z-matrikami | 2803f936dc67db1ec308cc1e9be35f434e4b58ef | [
"MIT"
] | null | null | null | tekstovni_vmesnik.py | milaneztim/Racunanje-z-matrikami | 2803f936dc67db1ec308cc1e9be35f434e4b58ef | [
"MIT"
] | null | null | null | import model
def dolzina_maksimalnega_clena(sez):
m = len(sez)
n = len(sez[0])
najvecji = max([sez[i][j] for i in range(m) for j in range(n)])
return len(str(najvecji))
def prikaz_matrike(sez):
m = len(sez)
n = len(sez[0])
razmik = dolzina_maksimalnega_clena(sez)
for i in range(m):
... | 25.264706 | 76 | 0.495343 | import model
def dolzina_maksimalnega_clena(sez):
m = len(sez)
n = len(sez[0])
najvecji = max([sez[i][j] for i in range(m) for j in range(n)])
return len(str(najvecji))
def prikaz_matrike(sez):
m = len(sez)
n = len(sez[0])
razmik = dolzina_maksimalnega_clena(sez)
for i in range(m):
... | true | true |
f7fb854f0cf77eb371f83668283aa1310a428d43 | 272 | py | Python | paraVerComoFuncionaAlgumasCoisas/pythonParaAnaliseDeDados/capitulo4-basicosobreONumPy-arrayseprocessamentovetorizado/ipython_3_criando_ndarrays.py | jonasht/pythonEstudos | 5e7d28e7bd82b9d1b08e795867fdbaa743f4b747 | [
"MIT"
] | null | null | null | paraVerComoFuncionaAlgumasCoisas/pythonParaAnaliseDeDados/capitulo4-basicosobreONumPy-arrayseprocessamentovetorizado/ipython_3_criando_ndarrays.py | jonasht/pythonEstudos | 5e7d28e7bd82b9d1b08e795867fdbaa743f4b747 | [
"MIT"
] | null | null | null | paraVerComoFuncionaAlgumasCoisas/pythonParaAnaliseDeDados/capitulo4-basicosobreONumPy-arrayseprocessamentovetorizado/ipython_3_criando_ndarrays.py | jonasht/pythonEstudos | 5e7d28e7bd82b9d1b08e795867fdbaa743f4b747 | [
"MIT"
] | null | null | null | # coding: utf-8
data1 = [6, 7.5, 8., 0., 1.]
import numpy as np
arr1 = np.array(data1)
arr1
data2 = [[1,2,3,4], [5,6,7,8]]
arr2 = np.array(data2)
arr2
arr2.ndim
arr2.shape
arr1.dtype
arr2.dtype
np.zeros(3,6)
np.zeros(10)
np.zeros((3, 6))
np.empty((2, 3, 2))
np.arange(15)
| 15.111111 | 30 | 0.628676 |
data1 = [6, 7.5, 8., 0., 1.]
import numpy as np
arr1 = np.array(data1)
arr1
data2 = [[1,2,3,4], [5,6,7,8]]
arr2 = np.array(data2)
arr2
arr2.ndim
arr2.shape
arr1.dtype
arr2.dtype
np.zeros(3,6)
np.zeros(10)
np.zeros((3, 6))
np.empty((2, 3, 2))
np.arange(15)
| true | true |
f7fb862ec69a2f9eb576e4b18782dadf710db374 | 2,775 | py | Python | pems/originals/analyze.py | start2020/MSGC-Seq2Seq | 70f8db9293c8033a4b4f03f30a0164c360c4bcd0 | [
"MIT"
] | null | null | null | pems/originals/analyze.py | start2020/MSGC-Seq2Seq | 70f8db9293c8033a4b4f03f30a0164c360c4bcd0 | [
"MIT"
] | null | null | null | pems/originals/analyze.py | start2020/MSGC-Seq2Seq | 70f8db9293c8033a4b4f03f30a0164c360c4bcd0 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import datetime
# traffic_file = "PeMS.h5"
# df = pd.read_hdf(traffic_file)
#
# data = df.values
# # tmp_df = df[0]
# # tmf_file_name = "tmp.xlsx" #保存后删除第一列
# # tmp_df.to_excel()
# # print(tmp_df)
#
# new_pf = pd.read_excel('./tmp.xlsx', sheet_name = 0)
# Time = d... | 31.896552 | 134 | 0.624505 | import pandas as pd
import numpy as np
import datetime
nt("T1 ",T1)
Time = new_pf.index
data = new_pf.values
N = data.shape[-1]
days = data.shape[0]//T1
dayofweek = np.reshape(Time.weekday, newshape = (-1, 1))
timeofday = (Time.hour * 60 + Time.minute + Time.second / 60) // 5
timeofday = np.reshape... | true | true |
f7fb8659b00606d3e1564c69b93fb9358f73c590 | 11,309 | py | Python | gpytorch/variational/whitened_variational_strategy.py | Xiao-dong-Wang/gpytorch | 92e07cf4dae26083fe0aed926e1dfd483443924e | [
"MIT"
] | 2 | 2020-09-11T12:11:16.000Z | 2020-09-24T03:58:16.000Z | gpytorch/variational/whitened_variational_strategy.py | Xiao-dong-Wang/gpytorch | 92e07cf4dae26083fe0aed926e1dfd483443924e | [
"MIT"
] | null | null | null | gpytorch/variational/whitened_variational_strategy.py | Xiao-dong-Wang/gpytorch | 92e07cf4dae26083fe0aed926e1dfd483443924e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import math
import warnings
import torch
from .. import settings
from ..distributions import MultivariateNormal
from ..lazy import (
BatchRepeatLazyTensor,
CachedCGLazyTensor,
CholLazyTensor,
DiagLazyTensor,
MatmulLazyTensor,
PsdSumLazyTensor,
RootLazyTensor,
)
from... | 47.120833 | 120 | 0.633212 |
import math
import warnings
import torch
from .. import settings
from ..distributions import MultivariateNormal
from ..lazy import (
BatchRepeatLazyTensor,
CachedCGLazyTensor,
CholLazyTensor,
DiagLazyTensor,
MatmulLazyTensor,
PsdSumLazyTensor,
RootLazyTensor,
)
from ..module import Modul... | true | true |
f7fb86742df7ac32c13221dab28c03b55fcaa9c6 | 648 | py | Python | ciservice/apiv1/resource_services.py | idekerlab/ci-service-template | 5d46f030afe01a959c6afad0af35217347f4483a | [
"MIT"
] | 2 | 2015-10-02T18:41:09.000Z | 2015-10-16T20:57:01.000Z | ciservice/apiv1/resource_services.py | afcarl/ci-service-template | 5d46f030afe01a959c6afad0af35217347f4483a | [
"MIT"
] | 15 | 2015-05-05T22:46:37.000Z | 2021-01-20T22:55:30.000Z | ciservice/apiv1/resource_services.py | afcarl/ci-service-template | 5d46f030afe01a959c6afad0af35217347f4483a | [
"MIT"
] | 7 | 2015-04-20T20:48:36.000Z | 2015-11-13T02:35:36.000Z | # -*- coding: utf-8 -*-
import redis
from flask.ext.restful import Resource
from util_service import ServiceUtil
class ServicesResource(Resource):
"""
List of available services.
"""
def __init__(self):
self.__redis_conn = redis.Redis('redis', 6379)
self.__util = ServiceUtil()
d... | 22.344828 | 68 | 0.623457 |
import redis
from flask.ext.restful import Resource
from util_service import ServiceUtil
class ServicesResource(Resource):
def __init__(self):
self.__redis_conn = redis.Redis('redis', 6379)
self.__util = ServiceUtil()
def get(self):
registered_services = self.__redis_conn.hgetall('... | true | true |
f7fb8a415c67646d561d00f301e4aab06e437740 | 656 | py | Python | P2/assignment/testing_structures/enumerated_pairs.py | Pierrefha/introduction-to-ai-practials | 55050d710398d82a5358bc04fea5a4cac6f7b74f | [
"MIT"
] | null | null | null | P2/assignment/testing_structures/enumerated_pairs.py | Pierrefha/introduction-to-ai-practials | 55050d710398d82a5358bc04fea5a4cac6f7b74f | [
"MIT"
] | null | null | null | P2/assignment/testing_structures/enumerated_pairs.py | Pierrefha/introduction-to-ai-practials | 55050d710398d82a5358bc04fea5a4cac6f7b74f | [
"MIT"
] | null | null | null | def grouped(iterable, n):
""" s -> (s0,s1,s2,...sn-1), (sn,sn+1,sn+2,...s2n-1),
(s2n,s2n+1,s2n+2,...s3n-1), ...
"""
return zip(*[iter(iterable)]*n)
if __name__ == '__main__':
list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
it = iter(list)
for index, pair in enumerate(grouped(it, 2)):
pr... | 29.818182 | 64 | 0.532012 | def grouped(iterable, n):
return zip(*[iter(iterable)]*n)
if __name__ == '__main__':
list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
it = iter(list)
for index, pair in enumerate(grouped(it, 2)):
print(f"index:{index} pair:{pair} ")
first_num = pair[0]
second_num = pair[1]
print(... | true | true |
f7fb8abb999e47f25574fc099649d4000d19f0c7 | 1,431 | py | Python | examples/python/grib_set_missing.py | onyb/eccodes | 15b09889a89ff416c38ac7fb4fa336ffa257b12f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/python/grib_set_missing.py | onyb/eccodes | 15b09889a89ff416c38ac7fb4fa336ffa257b12f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/python/grib_set_missing.py | onyb/eccodes | 15b09889a89ff416c38ac7fb4fa336ffa257b12f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #
# Copyright 2005-2018 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovern... | 24.254237 | 78 | 0.691824 |
import traceback
import sys
from eccodes import *
INPUT = '../../data/tigge/tigge_ecmf_pl_t.grib'
OUTPUT = 'out.p_set_missing.grib'
VERBOSE = 1
def example():
fin = open(INPUT)
fout = open(OUTPUT, 'w')
gid = codes_grib_new_from_file(fin)
codes_set_long(gid, "scaledValueOfFirstFixedSur... | true | true |
f7fb8be92f70434194551673bf10388f3f18bab5 | 1,096 | py | Python | setup.py | sotpotatis/Eatery-Python | 8669958739f46a432a98f6fe4541060b6b9ec809 | [
"MIT"
] | null | null | null | setup.py | sotpotatis/Eatery-Python | 8669958739f46a432a98f6fe4541060b6b9ec809 | [
"MIT"
] | null | null | null | setup.py | sotpotatis/Eatery-Python | 8669958739f46a432a98f6fe4541060b6b9ec809 | [
"MIT"
] | null | null | null | """EATERY-NOD
Python library for interacting with the Lunchbot API for getting the menu of eatery Kista Nod.
API-docs are available at https://eatery.nero2k.com/api. This library is made by sotpotatis."""
import pathlib
from setuptools import setup
HERE = pathlib.Path(__file__).parent #Get the directory containing... | 40.592593 | 96 | 0.694343 | import pathlib
from setuptools import setup
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
setup(
name="lunchbot-python",
version="0.1.1",
url="https://github.com/sotpotatis/Lunchbot-Python",
description="Python interface for the Lunchbot API.",
long_descript... | true | true |
f7fb8c14472c378fd2e6e3881e1f55c47c995a86 | 14,508 | py | Python | src/pyx4_base/test_scripts/pyx4_test_logic.py | jannsta1/pyx4 | b0e72c25b8bb0e3e12d4d9de1af78cee7b13b11f | [
"BSD-2-Clause"
] | 1 | 2020-06-08T08:20:46.000Z | 2020-06-08T08:20:46.000Z | src/pyx4_base/test_scripts/pyx4_test_logic.py | jannsta1/pyx4 | b0e72c25b8bb0e3e12d4d9de1af78cee7b13b11f | [
"BSD-2-Clause"
] | 2 | 2020-07-13T11:23:05.000Z | 2020-07-14T20:50:53.000Z | src/pyx4_base/test_scripts/pyx4_test_logic.py | jannsta1/pyx4 | b0e72c25b8bb0e3e12d4d9de1af78cee7b13b11f | [
"BSD-2-Clause"
] | 2 | 2020-06-26T11:31:40.000Z | 2021-07-06T13:03:43.000Z | #!/usr/bin/env python3
""" ROS node to perform most of the testing logic.
- Manage subscriptions to relevant topics
- Parse all the data needed for testing
- Do the testing
- All the results are published to the /pyx4_test topic
"""
PKG = 'pyx4'
NAME = 'pyx4_test'
import sys, time, os, csv
import numpy as np
import... | 42.79646 | 79 | 0.578164 |
PKG = 'pyx4'
NAME = 'pyx4_test'
import sys, time, os, csv
import numpy as np
import rospy
from pyx4.msg import pyx4_state as Pyx4_msg
from pyx4.msg import pyx4_test as Pyx4_test_msg
from geometry_msgs.msg import PoseStamped, TwistStamped
from mavros_msgs.msg import PositionTarget
from pyx4_base_classes.definitions... | true | true |
f7fb8c23b3a011a8d70ddbac4f55bfb860b83333 | 21,067 | py | Python | twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py | timgates42/twilio-python | ef29d03a4857b62b616df4a8f4f2b7c294afbb99 | [
"MIT"
] | 2 | 2022-01-13T10:58:03.000Z | 2022-03-16T07:12:17.000Z | venv/Lib/site-packages/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | 9 | 2018-05-07T21:59:44.000Z | 2022-01-29T22:49:29.000Z | venv/Lib/site-packages/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | 4 | 2021-03-25T09:00:08.000Z | 2021-08-05T06:54:23.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base... | 36.385147 | 106 | 0.64537 |
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
from twilio.rest.numbers.v2.regulatory_compliance.... | true | true |
f7fb8c242e97184959fc16022a4706cd55db0ca0 | 998 | py | Python | example/client/healthcheck.py | saloponov/faiss-server | 641aeae0bdc730c5f65b6dbaca7c9434cc7ce855 | [
"MIT"
] | 106 | 2018-07-29T13:08:31.000Z | 2022-02-14T03:29:25.000Z | example/client/healthcheck.py | saloponov/faiss-server | 641aeae0bdc730c5f65b6dbaca7c9434cc7ce855 | [
"MIT"
] | 6 | 2018-07-29T21:39:32.000Z | 2022-03-13T19:09:18.000Z | example/client/healthcheck.py | saloponov/faiss-server | 641aeae0bdc730c5f65b6dbaca7c9434cc7ce855 | [
"MIT"
] | 28 | 2018-08-09T14:51:23.000Z | 2021-12-07T01:20:01.000Z | import argparse
import grpc
import faiss_pb2
import faiss_pb2_grpc
from google.protobuf import empty_pb2
def main(args):
# create channel and stub
address = '{}:{}'.format(args.host, args.port)
channel = grpc.insecure_channel(address)
stub = faiss_pb2_grpc.FaissServiceStub(channel)
response = stub... | 26.972973 | 79 | 0.62024 | import argparse
import grpc
import faiss_pb2
import faiss_pb2_grpc
from google.protobuf import empty_pb2
def main(args):
address = '{}:{}'.format(args.host, args.port)
channel = grpc.insecure_channel(address)
stub = faiss_pb2_grpc.FaissServiceStub(channel)
response = stub.Heartbeat.future(empty_p... | true | true |
f7fb8c34660b328529140b88cfa2be5c375ac9d2 | 3,131 | py | Python | box_mlc/modules/hierarchy_regularizer.py | iesl/box-mlc | 15439b7e46885458d0c45d530c17f1deac0398f8 | [
"MIT"
] | null | null | null | box_mlc/modules/hierarchy_regularizer.py | iesl/box-mlc | 15439b7e46885458d0c45d530c17f1deac0398f8 | [
"MIT"
] | null | null | null | box_mlc/modules/hierarchy_regularizer.py | iesl/box-mlc | 15439b7e46885458d0c45d530c17f1deac0398f8 | [
"MIT"
] | null | null | null | """Structural Regularization for """
from torch.nn.parameter import Parameter
from allennlp.common import Registrable
from allennlp.data.vocabulary import Vocabulary
from pathlib import Path
from networkx.exception import NetworkXException
from typing import List, Tuple, Union, Dict, Any, Optional
import torch
import n... | 35.579545 | 114 | 0.649633 | from torch.nn.parameter import Parameter
from allennlp.common import Registrable
from allennlp.data.vocabulary import Vocabulary
from pathlib import Path
from networkx.exception import NetworkXException
from typing import List, Tuple, Union, Dict, Any, Optional
import torch
import networkx as nx
import logging
from box... | true | true |
f7fb8c735eba4766c2da9793488577acce31d7c5 | 7,976 | py | Python | examples/docs_snippets/docs_snippets_tests/intro_tutorial_tests/test_cli_invocations.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets_tests/intro_tutorial_tests/test_cli_invocations.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets_tests/intro_tutorial_tests/test_cli_invocations.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | import json
import os
import runpy
import pytest
from click.testing import CliRunner
from dagit.app import create_app_from_workspace
from dagster.cli.pipeline import pipeline_execute_command
from dagster.cli.workspace import get_workspace_from_kwargs
from dagster.core.instance import DagsterInstance
from dagster.core.... | 24.847352 | 99 | 0.578235 | import json
import os
import runpy
import pytest
from click.testing import CliRunner
from dagit.app import create_app_from_workspace
from dagster.cli.pipeline import pipeline_execute_command
from dagster.cli.workspace import get_workspace_from_kwargs
from dagster.core.instance import DagsterInstance
from dagster.core.... | true | true |
f7fb8d225050c51183c45b2c72d33c3a0f270735 | 3,509 | py | Python | tests/client/sdk/text2text/test_models.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | tests/client/sdk/text2text/test_models.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | tests/client/sdk/text2text/test_models.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# 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 ... | 30.25 | 84 | 0.707324 |
import socket
from datetime import datetime
import pytest
from rubrix.client.models import Text2TextRecord
from rubrix.client.sdk.text2text.models import (
CreationText2TextRecord,
Text2TextAnnotation,
Text2TextBulkData,
Text2TextPrediction,
Text2TextQuery,
)
from rubrix.client.sdk.t... | true | true |
f7fb8e38121387cd150b1394c53c7edd1ff3d166 | 4,408 | py | Python | surveillancestation/api.py | k20human/py-surveillance-station | 94861da2dbf496352aabba6b6a3a2ab40bfd94f9 | [
"MIT"
] | 7 | 2017-10-27T06:25:48.000Z | 2020-12-12T15:36:21.000Z | surveillancestation/api.py | k20human/py-surveillance-station | 94861da2dbf496352aabba6b6a3a2ab40bfd94f9 | [
"MIT"
] | null | null | null | surveillancestation/api.py | k20human/py-surveillance-station | 94861da2dbf496352aabba6b6a3a2ab40bfd94f9 | [
"MIT"
] | 2 | 2021-11-25T03:07:30.000Z | 2021-12-14T05:16:28.000Z | import json
import logging
import requests
import urllib3
from .errors import errors
class Api:
def __init__(self, host, user, passwd):
self._host = host
self._user = user
self._passwd = passwd
self._sid = ''
self._logged_in = False
self._session_name = 'Surveillan... | 30.825175 | 104 | 0.547187 | import json
import logging
import requests
import urllib3
from .errors import errors
class Api:
def __init__(self, host, user, passwd):
self._host = host
self._user = user
self._passwd = passwd
self._sid = ''
self._logged_in = False
self._session_name = 'Surveillan... | true | true |
f7fb8e5b88c512b73143e15a8110e12e8a049a7f | 233 | py | Python | diff.py | DHDaniel/git-diff-clone | a0b06d4947948b45fbd8f4c70cb0d6032c4ab3d7 | [
"MIT"
] | 2 | 2020-09-13T13:10:41.000Z | 2021-08-14T23:28:42.000Z | diff.py | DHDaniel/git-diff-clone | a0b06d4947948b45fbd8f4c70cb0d6032c4ab3d7 | [
"MIT"
] | 3 | 2020-04-15T15:46:56.000Z | 2020-09-13T13:10:28.000Z | diff.py | DHDaniel/git-diff-clone | a0b06d4947948b45fbd8f4c70cb0d6032c4ab3d7 | [
"MIT"
] | 1 | 2020-09-13T12:38:04.000Z | 2020-09-13T12:38:04.000Z | #!/usr/bin/env python
from src.Differ import Differ
from src.utilities import Document
import sys
if __name__ == '__main__':
doc1 = Document(sys.argv[1])
doc2 = Document(sys.argv[2])
Differ.diff(doc1, doc2)
| 19.416667 | 35 | 0.665236 |
from src.Differ import Differ
from src.utilities import Document
import sys
if __name__ == '__main__':
doc1 = Document(sys.argv[1])
doc2 = Document(sys.argv[2])
Differ.diff(doc1, doc2)
| true | true |
f7fb8f153ed0fc749dd36febca997186eae0584b | 1,478 | py | Python | nimble_iot_bc/app.py | nimble-platform/tracking-iot-blockchain-service | 47917c9a1ea29982e3d88585a084764569e20d3a | [
"MIT"
] | 4 | 2019-12-13T19:19:20.000Z | 2021-08-15T16:28:53.000Z | nimble_iot_bc/app.py | nimble-platform/tracking-iot-blockchain-service | 47917c9a1ea29982e3d88585a084764569e20d3a | [
"MIT"
] | 1 | 2020-01-06T14:24:51.000Z | 2020-01-06T17:26:07.000Z | nimble_iot_bc/app.py | nimble-platform/tracking-iot-blockchain-service | 47917c9a1ea29982e3d88585a084764569e20d3a | [
"MIT"
] | 2 | 2019-11-20T08:53:28.000Z | 2021-03-18T03:17:28.000Z | import logging
from flask import Flask
from flask_cors import CORS
from nimble_iot_bc.apis import blueprint as api
from nimble_iot_bc.databases import mongo, influx
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
main_app = Flask(__name__)
def configure_app(flask_app):
'''Configure... | 24.633333 | 77 | 0.70636 | import logging
from flask import Flask
from flask_cors import CORS
from nimble_iot_bc.apis import blueprint as api
from nimble_iot_bc.databases import mongo, influx
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
main_app = Flask(__name__)
def configure_app(flask_app):
logger.info... | true | true |
f7fb8f574ca6ebca6871d9c9439eb183a2420dd6 | 13,829 | py | Python | salt/proxy/panos.py | dmyerscough/salt | d7b19ab64f0695568f78c12b4ba209e033903804 | [
"Apache-2.0"
] | 1 | 2021-08-14T13:48:38.000Z | 2021-08-14T13:48:38.000Z | salt/proxy/panos.py | dmyerscough/salt | d7b19ab64f0695568f78c12b4ba209e033903804 | [
"Apache-2.0"
] | null | null | null | salt/proxy/panos.py | dmyerscough/salt | d7b19ab64f0695568f78c12b4ba209e033903804 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Proxy Minion interface module for managing Palo Alto firewall devices.
:codeauthor: :email:`Spencer Ervin <spencer_ervin@hotmail.com>`
:maturity: new
:depends: none
:platform: unix
This proxy minion enables Palo Alto firewalls (hereafter referred to
as simply 'panos') to be treated... | 33.004773 | 130 | 0.606551 |
from __future__ import absolute_import
import logging
import salt.exceptions
__proxyenabled__ = ['panos']
# Variables are scoped to this module so we can have persistent data.
GRAINS_CACHE = {'vendor': 'Palo Alto'}
DETAILS = {}
# Set up logging
log = logging.getLogger(__file__)
# Define the module's virtual ... | true | true |
f7fb8f7c89b788e21fd08b45e00aa759617eaa13 | 67,639 | py | Python | src/amuse/community/mesa/interface.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 131 | 2015-06-04T09:06:57.000Z | 2022-02-01T12:11:29.000Z | src/amuse/community/mesa/interface.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 690 | 2015-10-17T12:18:08.000Z | 2022-03-31T16:15:58.000Z | src/amuse/community/mesa/interface.py | rieder/amuse | 3ac3b6b8f922643657279ddee5c8ab3fc0440d5e | [
"Apache-2.0"
] | 102 | 2015-01-22T10:00:29.000Z | 2022-02-09T13:29:43.000Z | import os
import numpy
from operator import itemgetter
from amuse.community import *
from amuse.community.interface.se import StellarEvolution, StellarEvolutionInterface, \
InternalStellarStructure, InternalStellarStructureInterface
from amuse.units.quantities import VectorQuantity
from amuse.support.interface im... | 43.75097 | 152 | 0.635122 | import os
import numpy
from operator import itemgetter
from amuse.community import *
from amuse.community.interface.se import StellarEvolution, StellarEvolutionInterface, \
InternalStellarStructure, InternalStellarStructureInterface
from amuse.units.quantities import VectorQuantity
from amuse.support.interface im... | true | true |
f7fb8f81600e0b3d8bd12850f84d936d411cae09 | 1,909 | py | Python | tests/st/ops/ascend/vector/test_elemwise_mul_ad_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/st/ops/ascend/vector/test_elemwise_mul_ad_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/st/ops/ascend/vector/test_elemwise_mul_ad_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 31.816667 | 88 | 0.663698 |
import os
import pytest
from tests.common.base import TestBase
from tests.common.test_run.ascend.elemwise_mul_ad_run import elemwise_mul_ad_run
class TestCase(TestBase):
def setup(self):
case_name = "test_autodiff_elemwise_mul_ad_001"
case_path = os.getcwd()
self.params_ini... | true | true |
f7fb8fff4b6a671f41bc2286c696128d85e52c59 | 468 | py | Python | _app/comments/models.py | OmarThinks/DRF-Social-Project | e012c0d9e42e07948ef2fd7e391211ecf566a79a | [
"MIT"
] | null | null | null | _app/comments/models.py | OmarThinks/DRF-Social-Project | e012c0d9e42e07948ef2fd7e391211ecf566a79a | [
"MIT"
] | null | null | null | _app/comments/models.py | OmarThinks/DRF-Social-Project | e012c0d9e42e07948ef2fd7e391211ecf566a79a | [
"MIT"
] | null | null | null | from django.db import models
from django.conf import settings
from posts.models import Post
class Comment(models.Model):
post = models.ForeignKey(Post,
on_delete=models.CASCADE,related_name='comments')
content = models.CharField(max_length=1000)
author = models.ForeignKey(settings.AUTH_USER_MODEL,
on_delete=mo... | 31.2 | 57 | 0.745726 | from django.db import models
from django.conf import settings
from posts.models import Post
class Comment(models.Model):
post = models.ForeignKey(Post,
on_delete=models.CASCADE,related_name='comments')
content = models.CharField(max_length=1000)
author = models.ForeignKey(settings.AUTH_USER_MODEL,
on_delete=mo... | true | true |
f7fb90fb0475755686c72bb5f11a9b5d29b43359 | 395 | py | Python | my_nubank.py | janjitsu/nuflow | 47715218c8ea11407a767fda63a2d06cd1f8031d | [
"MIT"
] | 2 | 2018-03-16T18:11:20.000Z | 2018-03-16T23:14:09.000Z | my_nubank.py | janjitsu/nuflow | 47715218c8ea11407a767fda63a2d06cd1f8031d | [
"MIT"
] | null | null | null | my_nubank.py | janjitsu/nuflow | 47715218c8ea11407a767fda63a2d06cd1f8031d | [
"MIT"
] | null | null | null | # This class will fetch a Pynubank class with user credentials
import json
from pynubank import Nubank
class MyNubank:
def __new__(self):
credentials = json.load(open('credentials/nubank_credentials.json'))
return Nubank(credentials['cpf'],credentials['password'])
if __name__ == '__main__':
fr... | 26.333333 | 76 | 0.721519 |
import json
from pynubank import Nubank
class MyNubank:
def __new__(self):
credentials = json.load(open('credentials/nubank_credentials.json'))
return Nubank(credentials['cpf'],credentials['password'])
if __name__ == '__main__':
from pprint import pprint
my_nubank = MyNubank();
pprin... | true | true |
f7fb91bda1f8426ece53df6d0828880601147d94 | 5,794 | py | Python | benchmarks/classification/svm_voc07/extract.py | Westlake-AI/openmixup | ea81250819e740dd823e30cb7ce382d14a3c1b91 | [
"Apache-2.0"
] | 10 | 2021-12-30T10:22:27.000Z | 2022-03-30T02:31:38.000Z | benchmarks/classification/svm_voc07/extract.py | Westlake-AI/openmixup | ea81250819e740dd823e30cb7ce382d14a3c1b91 | [
"Apache-2.0"
] | 3 | 2022-01-20T21:02:48.000Z | 2022-03-19T13:49:45.000Z | benchmarks/classification/svm_voc07/extract.py | Westlake-AI/openmixup | ea81250819e740dd823e30cb7ce382d14a3c1b91 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os
import os.path as osp
import time
import mmcv
import numpy as np
import torch
from mmcv import DictAction
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import get_dist_info, init_dist, load_checkpoint
from... | 37.380645 | 79 | 0.651018 |
import argparse
import os
import os.path as osp
import time
import mmcv
import numpy as np
import torch
from mmcv import DictAction
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import get_dist_info, init_dist, load_checkpoint
from openmixup.datasets import build_dataloader, bu... | true | true |
f7fb92077bc5cb50669d9a8947dcdd3be5894730 | 5,257 | py | Python | code/mpu6050.py | piNp187/gyroscope | f23b8fb47ab2a05319e4212a85261f3197592daa | [
"CC-BY-4.0"
] | 1 | 2022-03-24T09:43:05.000Z | 2022-03-24T09:43:05.000Z | code/mpu6050.py | piNp187/gyroscope | f23b8fb47ab2a05319e4212a85261f3197592daa | [
"CC-BY-4.0"
] | null | null | null | code/mpu6050.py | piNp187/gyroscope | f23b8fb47ab2a05319e4212a85261f3197592daa | [
"CC-BY-4.0"
] | null | null | null | import machine
from machine import I2C, Pin
import time
MPU_ADDR = const(0X68)
MPU_DEVICE_ID_REG = 0x75
MPU_PWR_MGMT1_REG = 0x6B
MPU_PWR_MGMT2_REG = 0x6C
MPU_SELF_TESTX_REG = 0x0D
MPU_SELF_TESTY_REG = 0x0E
MPU_SELF_TESTZ_REG = 0x0F
MPU_SELF_TESTA_REG = 0x10
MPU_SAMPLE_RATE_R... | 29.700565 | 77 | 0.604718 | import machine
from machine import I2C, Pin
import time
MPU_ADDR = const(0X68)
MPU_DEVICE_ID_REG = 0x75
MPU_PWR_MGMT1_REG = 0x6B
MPU_PWR_MGMT2_REG = 0x6C
MPU_SELF_TESTX_REG = 0x0D
MPU_SELF_TESTY_REG = 0x0E
MPU_SELF_TESTZ_REG = 0x0F
MPU_SELF_TESTA_REG = 0x10
MPU_SAMPLE_RATE_R... | true | true |
f7fb921e54642b921355f2d5b25983827d741b17 | 3,940 | py | Python | vispy/visuals/filters/clipping_planes.py | Dive576/vispy | 06bedb0e9aa410505dbe283d2c52dc9b168f8ded | [
"BSD-3-Clause"
] | 2,617 | 2015-01-02T07:52:18.000Z | 2022-03-29T19:31:15.000Z | vispy/visuals/filters/clipping_planes.py | Dive576/vispy | 06bedb0e9aa410505dbe283d2c52dc9b168f8ded | [
"BSD-3-Clause"
] | 1,674 | 2015-01-01T00:36:08.000Z | 2022-03-31T19:35:56.000Z | vispy/visuals/filters/clipping_planes.py | Dive576/vispy | 06bedb0e9aa410505dbe283d2c52dc9b168f8ded | [
"BSD-3-Clause"
] | 719 | 2015-01-10T14:25:00.000Z | 2022-03-02T13:24:56.000Z | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from functools import lru_cache
import numpy as np
from ..shaders import Function, Varying
from .base_filter import Filter
class PlanesClipper(Filter):
... | 35.818182 | 114 | 0.641878 |
from functools import lru_cache
import numpy as np
from ..shaders import Function, Varying
from .base_filter import Filter
class PlanesClipper(Filter):
VERT_CODE = """
void clip() {
// Transform back to visual coordinates and clip based on that
$v_distance_from_clip = $clip_with_planes(... | true | true |
f7fb954c6a940503ff310e8f01ba7d7f09a3394c | 12,823 | py | Python | src/sage/geometry/polyhedron/backend_field.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/geometry/polyhedron/backend_field.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/geometry/polyhedron/backend_field.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2019-06-02T03:16:55.000Z | 2019-06-02T03:16:55.000Z | """
The Python backend
While slower than specialized C/C++ implementations, the
implementation is general and works with any exact field in Sage that
allows you to define polyhedra.
EXAMPLES::
sage: p0 = (0, 0)
sage: p1 = (1, 0)
sage: p2 = (1/2, AA(3).sqrt()/2)
sage: equilateral_triangle = Polyhedron... | 36.74212 | 99 | 0.567652 | from __future__ import absolute_import
from .base import Polyhedron_base
from sage.structure.element import Element
class Polyhedron_field(Polyhedron_base):
def _is_zero(self, x):
return x == 0
def _is_nonneg(self, x):
return x >= 0
def _is_positive(self, x):
return x ... | true | true |
f7fb975231ce929afd221757cd5244aa3ab77027 | 11,618 | py | Python | tech_project/lib/python2.7/site-packages/cms/utils/permissions.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 4 | 2019-05-09T02:09:54.000Z | 2021-11-09T11:27:19.000Z | cms/utils/permissions.py | thisisalamin/django-cms | eeb1e4712b3866e243daf800c142e2199e4be9df | [
"BSD-3-Clause"
] | 12 | 2021-05-14T04:40:33.000Z | 2022-01-10T01:54:36.000Z | cms/utils/permissions.py | thisisalamin/django-cms | eeb1e4712b3866e243daf800c142e2199e4be9df | [
"BSD-3-Clause"
] | 4 | 2019-01-26T09:58:37.000Z | 2019-06-24T08:12:43.000Z | # -*- coding: utf-8 -*-
from collections import defaultdict
from contextlib import contextmanager
from functools import wraps
from threading import local
from django.contrib.auth import get_permission_codename, get_user_model
from django.contrib.auth.models import Group
from django.db.models import Q
from django.utils... | 30.020672 | 115 | 0.661474 |
from collections import defaultdict
from contextlib import contextmanager
from functools import wraps
from threading import local
from django.contrib.auth import get_permission_codename, get_user_model
from django.contrib.auth.models import Group
from django.db.models import Q
from django.utils.decorators import avai... | true | true |
f7fb97a1d5d5389acfdae56a02224b51aa7385f8 | 74 | py | Python | src/square_root.py | anikchatt/IS601_calculator | 9057e3205a689446bc9fae659cd3eed31aea91eb | [
"MIT"
] | null | null | null | src/square_root.py | anikchatt/IS601_calculator | 9057e3205a689446bc9fae659cd3eed31aea91eb | [
"MIT"
] | null | null | null | src/square_root.py | anikchatt/IS601_calculator | 9057e3205a689446bc9fae659cd3eed31aea91eb | [
"MIT"
] | null | null | null | def square_root(a):
a = float(a)
value = a ** .5
return value
| 14.8 | 19 | 0.540541 | def square_root(a):
a = float(a)
value = a ** .5
return value
| true | true |
f7fb97db3220bbc64ca010f0349740e9c79f310a | 178 | py | Python | bus_system/apps/bus_driver/admin.py | pygabo/bus_system | ffb76d3414e058286799f3df1cb551b26286e7c3 | [
"MIT"
] | null | null | null | bus_system/apps/bus_driver/admin.py | pygabo/bus_system | ffb76d3414e058286799f3df1cb551b26286e7c3 | [
"MIT"
] | null | null | null | bus_system/apps/bus_driver/admin.py | pygabo/bus_system | ffb76d3414e058286799f3df1cb551b26286e7c3 | [
"MIT"
] | null | null | null | # Core Django imports
from django.contrib import admin
# Imports from my apps
from bus_system.apps.bus_driver.models import BusDriverModel
admin.site.register(BusDriverModel)
| 22.25 | 60 | 0.825843 |
from django.contrib import admin
from bus_system.apps.bus_driver.models import BusDriverModel
admin.site.register(BusDriverModel)
| true | true |
f7fb98cc1d59d5cda7836c98dff49d525cd406e1 | 6,717 | py | Python | salt/modules/hashutil.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:21.000Z | 2020-01-02T09:03:21.000Z | salt/modules/hashutil.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | null | null | null | salt/modules/hashutil.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:24.000Z | 2020-01-02T09:03:24.000Z | # encoding: utf-8
'''
A collection of hashing and encoding functions
'''
from __future__ import absolute_import
# Import python libs
import base64
import hashlib
import hmac
# Import Salt libs
import salt.exceptions
from salt.ext import six
import salt.utils
import salt.utils.files
import salt.utils.hashutils
import ... | 23.242215 | 122 | 0.659223 |
from __future__ import absolute_import
import base64
import hashlib
import hmac
import salt.exceptions
from salt.ext import six
import salt.utils
import salt.utils.files
import salt.utils.hashutils
import salt.utils.stringutils
if six.PY2:
import StringIO
elif six.PY3:
from io import StringIO
def digest... | true | true |
f7fb98df9756aed8d07d6a928edbfde6089a2406 | 8,003 | py | Python | Applications/FlaskApp/flask_app.py | cemac-ccs/Faze-In_App | 5a937360b34357785699e36587d6457c2dd88806 | [
"MIT"
] | null | null | null | Applications/FlaskApp/flask_app.py | cemac-ccs/Faze-In_App | 5a937360b34357785699e36587d6457c2dd88806 | [
"MIT"
] | null | null | null | Applications/FlaskApp/flask_app.py | cemac-ccs/Faze-In_App | 5a937360b34357785699e36587d6457c2dd88806 | [
"MIT"
] | null | null | null | """Routes for core Flask app."""
from flask import current_app as app
from flask import render_template, flash, redirect, url_for, request
from flask import session, abort, Blueprint
#from wtforms import Form, validators, StringField, SelectField, TextAreaField
#from wtforms import IntegerField, PasswordField, SelectMu... | 35.411504 | 86 | 0.638386 | from flask import current_app as app
from flask import render_template, flash, redirect, url_for, request
from flask import session, abort, Blueprint
import sqlite3
import pandas as pd
import os
from passlib.hash import sha256_crypt
from .access import ChangePwdForm, AccessForm
from .access import table_list, use... | true | true |
f7fb990918f7ec59ef84bbe86bbf6ef0eab0ef09 | 464 | py | Python | data/scripts/templates/object/draft_schematic/clothing/shared_clothing_backpack_field_03.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/draft_schematic/clothing/shared_clothing_backpack_field_03.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/draft_schematic/clothing/shared_clothing_backpack_field_03.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_backpack_field_03.iff"
result.att... | 27.294118 | 90 | 0.737069 | true | true | |
f7fb99a703ddf58395a12a45c57820bb259a2284 | 3,766 | py | Python | submitit/core/test_utils.py | jrapin/submitit | dac5c6b76a81401aa7d44a32357872ebf92b968a | [
"MIT"
] | 602 | 2020-05-12T08:06:19.000Z | 2022-03-31T11:44:21.000Z | submitit/core/test_utils.py | mbchang/submitit | e37899bce0c7c58e3cc46ecb5b7fa8ce941fc3d7 | [
"MIT"
] | 1,639 | 2020-06-01T12:06:20.000Z | 2022-03-31T17:06:19.000Z | submitit/core/test_utils.py | mbchang/submitit | e37899bce0c7c58e3cc46ecb5b7fa8ce941fc3d7 | [
"MIT"
] | 55 | 2020-05-20T14:05:52.000Z | 2022-03-11T21:49:53.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
import os
import shutil
import sys
from pathlib import Path
from typing import Optional
import pytest
from . import utils
@pytest.mark.p... | 33.625 | 95 | 0.701806 |
import os
import shutil
import sys
from pathlib import Path
from typing import Optional
import pytest
from . import utils
@pytest.mark.parametrize("existing_content", [None, "blublu"])
def test_temporary_save_path(tmp_path: Path, existing_content: Optional[str]) -> None:
filepath = tmp_path / "save_and_... | true | true |
f7fb99f2e45a7b9638c12d2cd6ab44c44cbcda9a | 24,358 | py | Python | stable_baselines/deepq_lstm/build_graph.py | kevslinger/stable-baselines | 4bf9f3c1db49f462f5fb35df967d836d92a3dbcd | [
"MIT"
] | null | null | null | stable_baselines/deepq_lstm/build_graph.py | kevslinger/stable-baselines | 4bf9f3c1db49f462f5fb35df967d836d92a3dbcd | [
"MIT"
] | null | null | null | stable_baselines/deepq_lstm/build_graph.py | kevslinger/stable-baselines | 4bf9f3c1db49f462f5fb35df967d836d92a3dbcd | [
"MIT"
] | null | null | null | """Deep Q learning graph
The functions in this file can are used to create the following functions:
======= act ========
Function to chose an action given an observation
:param observation: (Any) Observation that can be feed into the output of make_obs_ph
:param stochastic: (bool) if set to False all th... | 50.53527 | 123 | 0.684539 | import tensorflow as tf
from gym.spaces import MultiDiscrete
from stable_baselines.common import tf_util
def scope_vars(scope, trainable_only=False):
return tf.get_collection(
tf.GraphKeys.TRAINABLE_VARIABLES if trainable_only else tf.GraphKeys.GLOBAL_VARIABLES,
scope=scope if isinstance(scope, s... | true | true |
f7fb9b1df0ffd7fffa7f50ab711f37db3c8c17ea | 256 | py | Python | example.py | chuxbraganza/Wrapper-Python | 5d46d47da48a6f4e19a974a6308cbae8b303ec47 | [
"MIT"
] | null | null | null | example.py | chuxbraganza/Wrapper-Python | 5d46d47da48a6f4e19a974a6308cbae8b303ec47 | [
"MIT"
] | null | null | null | example.py | chuxbraganza/Wrapper-Python | 5d46d47da48a6f4e19a974a6308cbae8b303ec47 | [
"MIT"
] | null | null | null | from mistyPy import Robot
# TODO: Replace with your IP
misty = Robot("192.168.0.31") # This is the IP of my misty. Replace with your IP
misty.changeLED(0, 0, 255)
misty.moveHeadPosition(0, 0, 0, 100) # center the head
misty.moveArmsDegrees(0, 0, 100, 100) | 36.571429 | 80 | 0.726563 | from mistyPy import Robot
misty = Robot("192.168.0.31")
misty.changeLED(0, 0, 255)
misty.moveHeadPosition(0, 0, 0, 100)
misty.moveArmsDegrees(0, 0, 100, 100) | true | true |
f7fb9be3d99bff340ea4263655787d4e301fa063 | 21,075 | py | Python | test/functional/test_framework/script.py | AlphaconTeam/AlphaconNetwork | c484de626f36c04ecf3f177807fe52ed8d7470c4 | [
"MIT"
] | 1 | 2019-11-18T12:15:51.000Z | 2019-11-18T12:15:51.000Z | test/functional/test_framework/script.py | AlphaconTeam/AlphaconNetwork | c484de626f36c04ecf3f177807fe52ed8d7470c4 | [
"MIT"
] | null | null | null | test/functional/test_framework/script.py | AlphaconTeam/AlphaconNetwork | c484de626f36c04ecf3f177807fe52ed8d7470c4 | [
"MIT"
] | 2 | 2019-06-17T14:47:21.000Z | 2021-01-16T07:25:13.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Alphacon Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Functionality to build scripts, as well as SignatureH... | 30.150215 | 146 | 0.614282 |
from .mininode import CTransaction, CTxOut, sha256, hash256, uint256_from_str, ser_uint256, ser_string
from binascii import hexlify
import hashlib
import sys
bchr = chr
bord = ord
if sys.version > '3':
long = int
bchr = lambda x: bytes([x])
bord = lambda x: x
import struct
from .bignum import bn2vc... | true | true |
f7fb9c866385126f70956e6bc9f7c3c83521f4b6 | 4,927 | py | Python | docs/examples/adv_motion_correction2.py | jklymak/dolfyn | eea98fe0021886cf654e25293c385c5c3707ff8d | [
"BSD-3-Clause"
] | null | null | null | docs/examples/adv_motion_correction2.py | jklymak/dolfyn | eea98fe0021886cf654e25293c385c5c3707ff8d | [
"BSD-3-Clause"
] | null | null | null | docs/examples/adv_motion_correction2.py | jklymak/dolfyn | eea98fe0021886cf654e25293c385c5c3707ff8d | [
"BSD-3-Clause"
] | null | null | null | import dolfyn as dlfn
import dolfyn.adv.api as api
import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mpldt
##############################################################################
# User-input data
fname = '../../dolfyn/example_data/vector_data_imu01.VE... | 37.9 | 78 | 0.661457 | import dolfyn as dlfn
import dolfyn.adv.api as api
import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mpldt
| true | true |
f7fb9d5cd1845c1259c4d4a0eb730b23c778b855 | 3,876 | py | Python | awscliv2/installers.py | vemel/awscliv2 | f9eb8694bca24d1746eeb46a3a57fcbf9f5d70ef | [
"MIT"
] | 18 | 2020-09-03T19:16:36.000Z | 2022-03-31T18:25:52.000Z | awscliv2/installers.py | vemel/awscliv2 | f9eb8694bca24d1746eeb46a3a57fcbf9f5d70ef | [
"MIT"
] | 5 | 2020-09-03T19:22:57.000Z | 2022-03-04T20:16:14.000Z | awscliv2/installers.py | vemel/awscliv2 | f9eb8694bca24d1746eeb46a3a57fcbf9f5d70ef | [
"MIT"
] | 1 | 2021-11-25T16:19:25.000Z | 2021-11-25T16:19:25.000Z | """
AWS CLI v2 installers.
"""
import os
import platform
import shutil
from io import StringIO
from pathlib import Path
from tempfile import NamedTemporaryFile, TemporaryDirectory
from urllib.request import urlopen
from zipfile import ZipFile
from awscliv2.constants import LINUX_ARM_URL, LINUX_X86_64_URL, MACOS_URL
fr... | 29.815385 | 84 | 0.635965 | import os
import platform
import shutil
from io import StringIO
from pathlib import Path
from tempfile import NamedTemporaryFile, TemporaryDirectory
from urllib.request import urlopen
from zipfile import ZipFile
from awscliv2.constants import LINUX_ARM_URL, LINUX_X86_64_URL, MACOS_URL
from awscliv2.exceptions import I... | true | true |
f7fb9e15b3d5cf5d108075e52b71c83afc13300b | 840 | py | Python | repository/migrations/0004_auto_20170109_0937.py | shuang3322/EdmureBlog | e2754157f82dad60bbb5094d45f8b536bcc33f50 | [
"Apache-2.0"
] | 47 | 2021-04-13T10:32:13.000Z | 2022-03-31T10:30:30.000Z | repository/migrations/0004_auto_20170109_0937.py | shuang3322/EdmureBlog | e2754157f82dad60bbb5094d45f8b536bcc33f50 | [
"Apache-2.0"
] | 1 | 2021-11-01T07:41:04.000Z | 2021-11-01T07:41:10.000Z | repository/migrations/0004_auto_20170109_0937.py | shuang3322/EdmureBlog | e2754157f82dad60bbb5094d45f8b536bcc33f50 | [
"Apache-2.0"
] | 21 | 2021-04-13T10:32:17.000Z | 2022-03-26T07:43:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-01-09 09:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('repository', '0003_auto_20170109_0935'),
]
operation... | 28.965517 | 137 | 0.609524 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('repository', '0003_auto_20170109_0935'),
]
operations = [
migrations.CreateModel(
name='Category',
... | true | true |
f7fb9f1cdb67e858c9683e7db6d762e36d90b899 | 2,608 | py | Python | plugins/plugins.py | lucasberti/telegrao-py | e8a275e39691e456b88f0dadcc6a76aa41e1612d | [
"MIT"
] | null | null | null | plugins/plugins.py | lucasberti/telegrao-py | e8a275e39691e456b88f0dadcc6a76aa41e1612d | [
"MIT"
] | null | null | null | plugins/plugins.py | lucasberti/telegrao-py | e8a275e39691e456b88f0dadcc6a76aa41e1612d | [
"MIT"
] | 6 | 2017-07-27T06:04:40.000Z | 2019-08-15T02:11:52.000Z | import config
from api import send_message
from reborn import is_sudoer
def on_msg_received(msg, matches):
# Checa se o usuário tem permissão e tem a quantidade correta de args no comando
command = matches.group(2)
plugin = matches.group(3)
if command is None and plugin is None:
string = ""
... | 39.515152 | 107 | 0.52684 | import config
from api import send_message
from reborn import is_sudoer
def on_msg_received(msg, matches):
command = matches.group(2)
plugin = matches.group(3)
if command is None and plugin is None:
string = ""
string += "atvdos::::: \n"
if len(config.plugins.items()) == 0:
... | true | true |
f7fb9fde20a922f2167716c435c2799b61a7e7dd | 2,325 | py | Python | scripts/eval/robustness_exp_text.py | alex-kj-chin/prototransformer-public | f6c82ea0e4a1fe57f19f161d4d659db2668f7313 | [
"MIT"
] | null | null | null | scripts/eval/robustness_exp_text.py | alex-kj-chin/prototransformer-public | f6c82ea0e4a1fe57f19f161d4d659db2668f7313 | [
"MIT"
] | null | null | null | scripts/eval/robustness_exp_text.py | alex-kj-chin/prototransformer-public | f6c82ea0e4a1fe57f19f161d4d659db2668f7313 | [
"MIT"
] | null | null | null | """Evaluate accuracy for 1000 episodes on test set."""
import os
import numpy as np
from src.agents.nlp import *
from src.utils.setup import process_config, process_config_from_json
from src.datasets.text import *
def evaluate(args, gpu_device=-1):
config_path = os.path.join(args.exp_dir, 'config.json')
che... | 31.418919 | 84 | 0.692043 |
import os
import numpy as np
from src.agents.nlp import *
from src.utils.setup import process_config, process_config_from_json
from src.datasets.text import *
def evaluate(args, gpu_device=-1):
config_path = os.path.join(args.exp_dir, 'config.json')
checkpoint_dir = os.path.join(args.exp_dir, 'checkpoints')... | true | true |
f7fb9ffdde0054952c056de8bc52073bd05e95da | 9,055 | py | Python | examples/sle_periodic/figure_1.py | fkemeth/emergent_pdes | d0501f21c9eb569543a19d4d95d6c91a9ccb11fe | [
"MIT"
] | null | null | null | examples/sle_periodic/figure_1.py | fkemeth/emergent_pdes | d0501f21c9eb569543a19d4d95d6c91a9ccb11fe | [
"MIT"
] | null | null | null | examples/sle_periodic/figure_1.py | fkemeth/emergent_pdes | d0501f21c9eb569543a19d4d95d6c91a9ccb11fe | [
"MIT"
] | null | null | null | """Initial plot for paper."""
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import int.matthews as mint
import fun.dmaps as dmaps
from mayavi import mlab
POINTS_W = 397.48499
plt.set_cmap('plasma')
def plot_1and2():
N = ... | 43.325359 | 102 | 0.559801 | import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import int.matthews as mint
import fun.dmaps as dmaps
from mayavi import mlab
POINTS_W = 397.48499
plt.set_cmap('plasma')
def plot_1and2():
N = 256
pars = {"gamma": 1.7, ... | true | true |
f7fba03d674a6b5572f014da7b92c849f0701810 | 3,778 | py | Python | Python/prover.py | BuserLukas/Logic | cc0447554cfa75b213a10a2db37ce82c42afb91d | [
"MIT"
] | 13 | 2019-10-03T13:25:02.000Z | 2021-12-26T11:49:25.000Z | Python/prover.py | BuserLukas/Logic | cc0447554cfa75b213a10a2db37ce82c42afb91d | [
"MIT"
] | 19 | 2015-01-14T15:36:24.000Z | 2019-04-21T02:13:23.000Z | Python/prover.py | BuserLukas/Logic | cc0447554cfa75b213a10a2db37ce82c42afb91d | [
"MIT"
] | 18 | 2019-10-03T16:05:46.000Z | 2021-12-10T19:44:15.000Z |
import folParser as fp
def parse(s):
return fp.LogicParser(s).parse()
import folCNF as cnf
import unify
from string import ascii_lowercase
def complement(l):
"Compute the complement of the literal l."
if l[0] == '¬':
return l[1]
else:
return ('¬', l)
def collectVariables(C):
i... | 28.621212 | 82 | 0.517205 |
import folParser as fp
def parse(s):
return fp.LogicParser(s).parse()
import folCNF as cnf
import unify
from string import ascii_lowercase
def complement(l):
if l[0] == '¬':
return l[1]
else:
return ('¬', l)
def collectVariables(C):
if isinstance(C, frozenset):
return { x ... | true | true |
f7fba056cdb6076e9bf7b924fb1ab04db98f7a08 | 3,001 | py | Python | setup.py | CHIPO-Project/temp | 99a38472bb12a10dcf2460ebfbfd7fa91ec35692 | [
"MIT"
] | null | null | null | setup.py | CHIPO-Project/temp | 99a38472bb12a10dcf2460ebfbfd7fa91ec35692 | [
"MIT"
] | 1 | 2021-06-02T00:43:25.000Z | 2021-06-02T00:43:25.000Z | setup.py | CHIPO-Project/temp | 99a38472bb12a10dcf2460ebfbfd7fa91ec35692 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# python setup.py sdist --format=zip,gztar
import os
import sys
import platform
import importlib.util
import argparse
import subprocess
from setuptools import setup, find_packages
from setuptools.command.install import install
MIN_PYTHON_VERSION = "3.6.1"
_min_python_version_tuple = tuple(map... | 31.589474 | 94 | 0.662113 |
import os
import sys
import platform
import importlib.util
import argparse
import subprocess
from setuptools import setup, find_packages
from setuptools.command.install import install
MIN_PYTHON_VERSION = "3.6.1"
_min_python_version_tuple = tuple(map(int, (MIN_PYTHON_VERSION.split("."))))
if sys.version_info[:3... | true | true |
f7fba101def49b948a1d90f3fd4d01321a63fcb4 | 67 | py | Python | typings/bl_i18n_utils/merge_po.py | Argmaster/PyR3 | 6786bcb6a101fe4bd4cc50fe43767b8178504b15 | [
"MIT"
] | 2 | 2021-12-12T18:51:52.000Z | 2022-02-23T09:49:16.000Z | src/blender/blender_autocomplete-master/2.92/bl_i18n_utils/merge_po.py | JonasWard/ClayAdventures | a716445ac690e4792e70658319aa1d5299f9c9e9 | [
"MIT"
] | 2 | 2021-11-08T12:09:02.000Z | 2021-12-12T23:01:12.000Z | typings/bl_i18n_utils/merge_po.py | Argmaster/PyR3 | 6786bcb6a101fe4bd4cc50fe43767b8178504b15 | [
"MIT"
] | null | null | null | import sys
import typing
def main():
'''
'''
pass
| 6.090909 | 13 | 0.477612 | import sys
import typing
def main():
pass
| true | true |
f7fba481c041dd7f36bebfdebccbbd1bf56935ba | 2,734 | py | Python | core/management/commands/reset.py | timgates42/timestrap | 744ebcb0cd5fc536245c18058236169f4f36cb8b | [
"BSD-2-Clause"
] | 1,758 | 2017-04-21T08:42:59.000Z | 2022-03-09T22:58:53.000Z | core/management/commands/reset.py | timgates42/timestrap | 744ebcb0cd5fc536245c18058236169f4f36cb8b | [
"BSD-2-Clause"
] | 172 | 2017-04-23T21:30:03.000Z | 2022-02-10T20:10:06.000Z | core/management/commands/reset.py | timgates42/timestrap | 744ebcb0cd5fc536245c18058236169f4f36cb8b | [
"BSD-2-Clause"
] | 138 | 2017-04-23T23:02:16.000Z | 2022-03-25T04:44:19.000Z | from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
from django.utils.six.moves import input
class Command(BaseCommand):
help = (
"Deletes all data from this instance and recreates the original "
"... | 32.939759 | 87 | 0.561814 | from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
from django.utils.six.moves import input
class Command(BaseCommand):
help = (
"Deletes all data from this instance and recreates the original "
"... | true | true |
f7fba4936d2b1fb37d77beb19c5971a0fc860471 | 21,320 | py | Python | backend-for-whatsapp/app.py | kenextra/WhatsappMessenger | bde7aa81c41384983d8cd1515db38be7be49d080 | [
"Apache-2.0"
] | 1 | 2021-08-02T01:09:58.000Z | 2021-08-02T01:09:58.000Z | backend-for-whatsapp/app.py | kenextra/WhatsappMessenger | bde7aa81c41384983d8cd1515db38be7be49d080 | [
"Apache-2.0"
] | null | null | null | backend-for-whatsapp/app.py | kenextra/WhatsappMessenger | bde7aa81c41384983d8cd1515db38be7be49d080 | [
"Apache-2.0"
] | null | null | null | """ Import Libraries """
from flask import Flask, render_template, request, jsonify
import requests
import os
import json
import math
import string
import pandas as pd
import numpy as np
import scipy as sp
from sklearn.preprocessing import OneHotEncoder, StandardScaler
from sklearn.pipeline import Pipeline
from sklear... | 35.47421 | 286 | 0.552486 |
from flask import Flask, render_template, request, jsonify
import requests
import os
import json
import math
import string
import pandas as pd
import numpy as np
import scipy as sp
from sklearn.preprocessing import OneHotEncoder, StandardScaler
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTr... | true | true |
f7fba53f0fbb830bd209ab71d4348a1fc352b178 | 2,262 | py | Python | setup.py | itaiw/databricks-cli | fdcb92499da5cda90c4436d5f09cdc697a8f46b9 | [
"Apache-2.0"
] | null | null | null | setup.py | itaiw/databricks-cli | fdcb92499da5cda90c4436d5f09cdc697a8f46b9 | [
"Apache-2.0"
] | null | null | null | setup.py | itaiw/databricks-cli | fdcb92499da5cda90c4436d5f09cdc697a8f46b9 | [
"Apache-2.0"
] | null | null | null | # Databricks CLI
# Copyright 2017 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"), except
# that the use of services to which certain application programming
# interfaces (each, an "API") connect requires that the user first obtain
# a license for the use of the APIs from Databricks,... | 35.904762 | 83 | 0.697171 |
import imp
import io
import os
from setuptools import setup, find_packages
version = imp.load_source(
'databricks_cli.version', os.path.join('databricks_cli', 'version.py')).version
setup(
name='databricks-cli',
version=version,
packages=find_packages(exclude=['tests', 'tests.*'... | true | true |
f7fba61f2b5e0c950aed03670c9958ba8e0453be | 9,247 | py | Python | wordle/solve.py | ZLLentz/wordle_calc | 02f654e01793d9d5303638dd84e2377c55436fa5 | [
"0BSD"
] | 1 | 2022-02-02T23:27:41.000Z | 2022-02-02T23:27:41.000Z | wordle/solve.py | ZLLentz/wordle_calc | 02f654e01793d9d5303638dd84e2377c55436fa5 | [
"0BSD"
] | null | null | null | wordle/solve.py | ZLLentz/wordle_calc | 02f654e01793d9d5303638dd84e2377c55436fa5 | [
"0BSD"
] | null | null | null | import logging
import multiprocessing
import time
from functools import cache, partial
from typing import Optional
from .game import SingleGame, WordEval
from .words import WordList
logger = logging.getLogger(__name__)
logger.spam = partial(logger.log, 5)
class Strategy:
hardcoded = ()
def __init__(
... | 30.72093 | 90 | 0.566562 | import logging
import multiprocessing
import time
from functools import cache, partial
from typing import Optional
from .game import SingleGame, WordEval
from .words import WordList
logger = logging.getLogger(__name__)
logger.spam = partial(logger.log, 5)
class Strategy:
hardcoded = ()
def __init__(
... | true | true |
f7fba643daf708683640e5dee531a0e8476b3cf5 | 4,897 | py | Python | molo/globalsite/tests/test_views.py | praekeltfoundation/molo.globalsite | 225d68de81b566aa8511e0326cf09b15fe7530c6 | [
"BSD-2-Clause"
] | null | null | null | molo/globalsite/tests/test_views.py | praekeltfoundation/molo.globalsite | 225d68de81b566aa8511e0326cf09b15fe7530c6 | [
"BSD-2-Clause"
] | 7 | 2018-05-10T14:36:41.000Z | 2018-10-18T08:27:51.000Z | molo/globalsite/tests/test_views.py | praekeltfoundation/molo.globalsite | 225d68de81b566aa8511e0326cf09b15fe7530c6 | [
"BSD-2-Clause"
] | null | null | null | import pytest
from django.test import TestCase, Client
from django.http.request import HttpRequest
from django.core.urlresolvers import reverse
from wagtail.wagtailcore.models import Site
from molo.core.tests.base import MoloTestCaseMixin
from molo.globalsite.models import CountrySite, GlobalSiteSettings, Region
from m... | 39.176 | 75 | 0.646927 | import pytest
from django.test import TestCase, Client
from django.http.request import HttpRequest
from django.core.urlresolvers import reverse
from wagtail.wagtailcore.models import Site
from molo.core.tests.base import MoloTestCaseMixin
from molo.globalsite.models import CountrySite, GlobalSiteSettings, Region
from m... | true | true |
f7fba69c4135fc23e640d964279a52b9682f3836 | 1,110 | py | Python | 2-resources/_PYTHON/code-examples-master/aws/python/dynamodb/create_and_tag_table.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_PYTHON/code-examples-master/aws/python/dynamodb/create_and_tag_table.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_PYTHON/code-examples-master/aws/python/dynamodb/create_and_tag_table.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | # Creates a DynamoDB Table: test_20181030 and Tags it
import boto3
import time
session = boto3.Session(region_name='eu-west-1', profile_name='test')
resource = session.resource('dynamodb')
client = session.client('dynamodb')
def create_table():
table_name = "test_{0}".format(time.strftime("%Y%m%d"))
response... | 27.073171 | 74 | 0.581081 |
import boto3
import time
session = boto3.Session(region_name='eu-west-1', profile_name='test')
resource = session.resource('dynamodb')
client = session.client('dynamodb')
def create_table():
table_name = "test_{0}".format(time.strftime("%Y%m%d"))
response = resource.create_table(
TableName=table_nam... | true | true |
f7fba76706ffed832bf27c13995f882ba9655203 | 5,645 | py | Python | nltk/corpus/reader/wordlist.py | RnDevelover/nltk | 87e23ff22fbdd14b5cd3ea44a48bcc46f50be551 | [
"Apache-2.0"
] | null | null | null | nltk/corpus/reader/wordlist.py | RnDevelover/nltk | 87e23ff22fbdd14b5cd3ea44a48bcc46f50be551 | [
"Apache-2.0"
] | null | null | null | nltk/corpus/reader/wordlist.py | RnDevelover/nltk | 87e23ff22fbdd14b5cd3ea44a48bcc46f50be551 | [
"Apache-2.0"
] | null | null | null | # Natural Language Toolkit: Word List Corpus Reader
#
# Copyright (C) 2001-2021 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# Edward Loper <edloper@gmail.com>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
from nltk.corpus.reader.api import *
from nltk.corpus.reader.uti... | 34.006024 | 201 | 0.606023 |
from nltk.corpus.reader.api import *
from nltk.corpus.reader.util import *
from nltk.tokenize import line_tokenize
class WordListCorpusReader(CorpusReader):
def words(self, fileids=None, ignore_lines_startswith="\n"):
return [
line
for line in line_tokenize(self.raw(fileids... | true | true |
f7fba7928c4013a5d6ab3f05a845ed74d4dbc12f | 969 | py | Python | my_code.py | Athenian-ComputerScience-Fall2020/my-age-Jackypop101 | 587841ee1b65534eb40b10490b7aa8ad36f0362c | [
"Apache-2.0"
] | null | null | null | my_code.py | Athenian-ComputerScience-Fall2020/my-age-Jackypop101 | 587841ee1b65534eb40b10490b7aa8ad36f0362c | [
"Apache-2.0"
] | null | null | null | my_code.py | Athenian-ComputerScience-Fall2020/my-age-Jackypop101 | 587841ee1b65534eb40b10490b7aa8ad36f0362c | [
"Apache-2.0"
] | null | null | null | # Complete the function below calculate your age after different numbers of years.
def age_now(x):
# My age now
print(f"I am currently {x} years old.\n")
def age_1(y):
# My age next year
print(f"Next year I'll be {y+1} years old.\n")
def age_10(z):
# My age in 10 years
print(f"In 10 years, I'... | 26.916667 | 105 | 0.638803 |
def age_now(x):
print(f"I am currently {x} years old.\n")
def age_1(y):
print(f"Next year I'll be {y+1} years old.\n")
def age_10(z):
# My age in 10 years
print(f"In 10 years, I'll be {z+10}!\n")
def age_50(q):
print(f"In 50 years, I'll be {q+50}! Wow!\n")
if __name__ == '__m... | true | true |
f7fba7cd4afb99a4ea6731070fd8cb5b47cfc793 | 7,836 | py | Python | Frcwp/Frcwp.py | sladesha/Frcwp | 421e8e831343bfeeeb31cb599598f059a563bbf8 | [
"MIT"
] | 47 | 2018-01-02T15:55:44.000Z | 2022-03-22T14:50:31.000Z | Frcwp/Frcwp.py | sladesha/Frcwp | 421e8e831343bfeeeb31cb599598f059a563bbf8 | [
"MIT"
] | 1 | 2018-05-22T01:54:57.000Z | 2018-05-22T01:54:57.000Z | Frcwp/Frcwp.py | sladesha/Frcwp | 421e8e831343bfeeeb31cb599598f059a563bbf8 | [
"MIT"
] | 7 | 2019-04-19T06:03:40.000Z | 2022-03-24T06:46:24.000Z | import pandas as pd
import numpy as np
import sys
from .reshapedata import natest as _natest
from .reshapedata import valuenumber, coltest, standardizeddata, formatcheck
from .distince import distince
from .slicing import grouped, isolationforest, iswhole
class Frcwp():
'''
param : na_rate : if na_rate != Non... | 45.034483 | 177 | 0.643951 | import pandas as pd
import numpy as np
import sys
from .reshapedata import natest as _natest
from .reshapedata import valuenumber, coltest, standardizeddata, formatcheck
from .distince import distince
from .slicing import grouped, isolationforest, iswhole
class Frcwp():
def __init__(self):
self.na_rate =... | true | true |
f7fbaa2a18f1329ee97c281d72bf234ca8b9cc61 | 13 | py | Python | app/tests/__init__.py | bobosoft/intrepyd | 13f0912b31f86f9bcc50f52ef4ad870e33f0cf65 | [
"BSD-3-Clause"
] | 2 | 2021-04-25T17:38:03.000Z | 2022-03-20T20:48:50.000Z | app/tests/__init__.py | bobosoft/intrepyd | 13f0912b31f86f9bcc50f52ef4ad870e33f0cf65 | [
"BSD-3-Clause"
] | 1 | 2016-11-30T22:25:00.000Z | 2017-01-16T22:43:39.000Z | app/tests/__init__.py | bobosoft/intrepyd | 13f0912b31f86f9bcc50f52ef4ad870e33f0cf65 | [
"BSD-3-Clause"
] | null | null | null | """
Tests
""" | 4.333333 | 5 | 0.384615 | true | true | |
f7fbaa39f08144a394f3528eced029a295e4cd57 | 503 | py | Python | env/Lib/site-packages/plotly/validators/choroplethmapbox/colorbar/_dtick.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/choroplethmapbox/colorbar/_dtick.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/choroplethmapbox/colorbar/_dtick.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class DtickValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(
self, plotly_name="dtick", parent_name="choroplethmapbox.colorbar", **kwargs
):
super(DtickValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | 33.533333 | 84 | 0.654076 | import _plotly_utils.basevalidators
class DtickValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(
self, plotly_name="dtick", parent_name="choroplethmapbox.colorbar", **kwargs
):
super(DtickValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | true | true |
f7fbaa5cfa1f86677ffd9b5dfd35292a782f7e57 | 560 | py | Python | src/openprocurement/tender/simpledefense/views/cancellation.py | ProzorroUKR/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 10 | 2020-02-18T01:56:21.000Z | 2022-03-28T00:32:57.000Z | src/openprocurement/tender/simpledefense/views/cancellation.py | quintagroup/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 26 | 2018-07-16T09:30:44.000Z | 2021-02-02T17:51:30.000Z | src/openprocurement/tender/simpledefense/views/cancellation.py | ProzorroUKR/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 15 | 2019-08-08T10:50:47.000Z | 2022-02-05T14:13:36.000Z | # -*- coding: utf-8 -*-
from openprocurement.tender.core.utils import optendersresource
from openprocurement.tender.openua.views.cancellation import TenderUaCancellationResource as TenderCancellationResource
@optendersresource(
name="simple.defense:Tender Cancellations",
collection_path="/tenders/{tender_id}/... | 37.333333 | 119 | 0.801786 |
from openprocurement.tender.core.utils import optendersresource
from openprocurement.tender.openua.views.cancellation import TenderUaCancellationResource as TenderCancellationResource
@optendersresource(
name="simple.defense:Tender Cancellations",
collection_path="/tenders/{tender_id}/cancellations",
pat... | true | true |
f7fbac947ff7b60430f8c5943807083ee505dfd9 | 2,899 | py | Python | letsencrypt-apache/letsencrypt_apache/tests/display_ops_test.py | mithrandi/letsencrypt | 8a8711a16ff94b9196868ed37eb22e716c5d8ba9 | [
"Apache-2.0"
] | 2 | 2017-03-13T23:04:40.000Z | 2021-12-11T07:11:01.000Z | letsencrypt-apache/letsencrypt_apache/tests/display_ops_test.py | mithrandi/letsencrypt | 8a8711a16ff94b9196868ed37eb22e716c5d8ba9 | [
"Apache-2.0"
] | null | null | null | letsencrypt-apache/letsencrypt_apache/tests/display_ops_test.py | mithrandi/letsencrypt | 8a8711a16ff94b9196868ed37eb22e716c5d8ba9 | [
"Apache-2.0"
] | 7 | 2017-08-10T21:33:51.000Z | 2021-06-03T15:53:50.000Z | """Test letsencrypt_apache.display_ops."""
import sys
import unittest
import mock
import zope.component
from letsencrypt.display import util as display_util
from letsencrypt import errors
from letsencrypt_apache import obj
from letsencrypt_apache.tests import util
class SelectVhostTest(unittest.TestCase):
"""... | 35.353659 | 88 | 0.693343 | import sys
import unittest
import mock
import zope.component
from letsencrypt.display import util as display_util
from letsencrypt import errors
from letsencrypt_apache import obj
from letsencrypt_apache.tests import util
class SelectVhostTest(unittest.TestCase):
def setUp(self):
zope.component.provi... | true | true |
f7fbadad51273535f63cef7042da911a9422fc57 | 1,020 | py | Python | mpa_admin_app/comments/routes.py | norbertorok92/flask_MVC | 134bb6fe9fcaf0550248a906055b17bbb3f31343 | [
"MIT"
] | null | null | null | mpa_admin_app/comments/routes.py | norbertorok92/flask_MVC | 134bb6fe9fcaf0550248a906055b17bbb3f31343 | [
"MIT"
] | null | null | null | mpa_admin_app/comments/routes.py | norbertorok92/flask_MVC | 134bb6fe9fcaf0550248a906055b17bbb3f31343 | [
"MIT"
] | null | null | null | from flask import (render_template, url_for, flash,
redirect, request, abort, Blueprint)
from flask_login import current_user, login_required
from mpa_admin_app import db
from mpa_admin_app.models import Comment
from mpa_admin_app.comments.forms import CommentForm
comments = Blueprint('comments', __... | 27.567568 | 92 | 0.748039 | from flask import (render_template, url_for, flash,
redirect, request, abort, Blueprint)
from flask_login import current_user, login_required
from mpa_admin_app import db
from mpa_admin_app.models import Comment
from mpa_admin_app.comments.forms import CommentForm
comments = Blueprint('comments', __... | true | true |
f7fbaff527a618e8f96d582f9b96d647e8d299dc | 431 | py | Python | Institute_Management_System/Institute_Management_System/asgi.py | Amitchawarekar/Institute_Management_System | 89fcf089e6c317647b28368b51304bfd1eda4743 | [
"MIT"
] | null | null | null | Institute_Management_System/Institute_Management_System/asgi.py | Amitchawarekar/Institute_Management_System | 89fcf089e6c317647b28368b51304bfd1eda4743 | [
"MIT"
] | null | null | null | Institute_Management_System/Institute_Management_System/asgi.py | Amitchawarekar/Institute_Management_System | 89fcf089e6c317647b28368b51304bfd1eda4743 | [
"MIT"
] | null | null | null | """
ASGI config for Institute_Management_System project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setd... | 25.352941 | 87 | 0.805104 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Institute_Management_System.settings')
application = get_asgi_application()
| true | true |
f7fbaffca520ad8bdd68aa052c50a385c674284f | 9,328 | py | Python | rootfs/api/models/__init__.py | deiscc/controller | 034be59c2f8860369f2dc8a96a553264aed0ec11 | [
"MIT"
] | null | null | null | rootfs/api/models/__init__.py | deiscc/controller | 034be59c2f8860369f2dc8a96a553264aed0ec11 | [
"MIT"
] | null | null | null | rootfs/api/models/__init__.py | deiscc/controller | 034be59c2f8860369f2dc8a96a553264aed0ec11 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Data models for the Deis API.
"""
import hashlib
import hmac
import importlib
import logging
import morph
import re
import urllib.parse
import uuid
from django.conf import settings
from django.db import models
from django.db.models.signals import post_delete, post_save
from django.dispatch... | 36.4375 | 104 | 0.66295 |
import hashlib
import hmac
import importlib
import logging
import morph
import re
import urllib.parse
import uuid
from django.conf import settings
from django.db import models
from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver
from rest_framework.exceptions import Valida... | true | true |
f7fbb0e21fd5862d16c0e9f042f42dfc7700ace5 | 1,963 | py | Python | modules/image/semantic_segmentation/humanseg_mobile/data_feed.py | chunzhang-hub/PaddleHub | c5cfd021f77fd59340fb26e223e09a592e6a345f | [
"Apache-2.0"
] | 8,360 | 2019-01-18T10:46:45.000Z | 2022-03-31T14:50:02.000Z | modules/image/semantic_segmentation/humanseg_mobile/data_feed.py | dwuping/PaddleHub | 9a3b23295947e22149cc85c17cb4cf23c03f9e06 | [
"Apache-2.0"
] | 1,158 | 2019-04-11T09:22:43.000Z | 2022-03-31T12:12:09.000Z | modules/image/semantic_segmentation/humanseg_mobile/data_feed.py | dwuping/PaddleHub | 9a3b23295947e22149cc85c17cb4cf23c03f9e06 | [
"Apache-2.0"
] | 1,677 | 2019-04-09T15:07:40.000Z | 2022-03-31T06:41:10.000Z | # -*- coding:utf-8 -*-
import os
import time
from collections import OrderedDict
import cv2
import numpy as np
__all__ = ['reader', 'preprocess_v']
def preprocess_v(img, w, h):
img = cv2.resize(img, (w, h), cv2.INTER_LINEAR).astype(np.float32)
img_mean = np.array([0.5, 0.5, 0.5]).reshape((3, 1, 1))
img_... | 31.15873 | 93 | 0.564952 |
import os
import time
from collections import OrderedDict
import cv2
import numpy as np
__all__ = ['reader', 'preprocess_v']
def preprocess_v(img, w, h):
img = cv2.resize(img, (w, h), cv2.INTER_LINEAR).astype(np.float32)
img_mean = np.array([0.5, 0.5, 0.5]).reshape((3, 1, 1))
img_std = np.array([0.5, 0... | true | true |
f7fbb17ed9afb0e45d4c5b38102a61493754e1be | 1,369 | py | Python | hackerrank/domain/algorithms/implementation/time_in_words/solution.py | spradeepv/dive-into-python | ec27d4686b7b007d21f9ba4f85d042be31ee2639 | [
"MIT"
] | null | null | null | hackerrank/domain/algorithms/implementation/time_in_words/solution.py | spradeepv/dive-into-python | ec27d4686b7b007d21f9ba4f85d042be31ee2639 | [
"MIT"
] | null | null | null | hackerrank/domain/algorithms/implementation/time_in_words/solution.py | spradeepv/dive-into-python | ec27d4686b7b007d21f9ba4f85d042be31ee2639 | [
"MIT"
] | null | null | null | units = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight',
'nine', 'ten']
teens = ['', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen',
'seventeen', 'eighteen', 'nineteen']
tens = ['', 'ten', 'twenty', 'thirty', 'forty', 'fifty']
h = int(raw_input())
m = int(raw_inpu... | 25.830189 | 78 | 0.402484 | units = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight',
'nine', 'ten']
teens = ['', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen',
'seventeen', 'eighteen', 'nineteen']
tens = ['', 'ten', 'twenty', 'thirty', 'forty', 'fifty']
h = int(raw_input())
m = int(raw_inpu... | true | true |
f7fbb2e83c7db86b9dbc095d2691fdd3e4312bad | 1,425 | py | Python | launchcontainer/browser_tests.py | appsembler/xblock-launchcontainer | 18bf840066efc128571f4b757720e01fc8e89c41 | [
"MIT"
] | 2 | 2016-11-24T04:41:20.000Z | 2017-05-11T14:42:40.000Z | launchcontainer/browser_tests.py | appsembler/xblock-launchcontainer | 18bf840066efc128571f4b757720e01fc8e89c41 | [
"MIT"
] | 34 | 2017-05-23T15:15:42.000Z | 2022-02-03T09:06:58.000Z | launchcontainer/browser_tests.py | appsembler/xblock-launchcontainer | 18bf840066efc128571f4b757720e01fc8e89c41 | [
"MIT"
] | 3 | 2017-04-29T16:12:06.000Z | 2019-08-01T20:41:50.000Z | import unittest
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
BASE_URL = 'http://localhost:8001'
USERNAME = 'YOUR_USERNAME'
PASSWORD = 'YOUR_PASSWORD'
cl... | 30.319149 | 86 | 0.664561 | import unittest
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
BASE_URL = 'http://localhost:8001'
USERNAME = 'YOUR_USERNAME'
PASSWORD = 'YOUR_PASSWORD'
cl... | true | true |
f7fbb51acebb5d249ad58c45726bc733e35b2963 | 9,695 | py | Python | bin/train_asr.py | voidism/End-to-end-ASR-Pytorch | 509c389fa6ab98c30e227c6f4c8f7474adbc1bb2 | [
"MIT"
] | null | null | null | bin/train_asr.py | voidism/End-to-end-ASR-Pytorch | 509c389fa6ab98c30e227c6f4c8f7474adbc1bb2 | [
"MIT"
] | null | null | null | bin/train_asr.py | voidism/End-to-end-ASR-Pytorch | 509c389fa6ab98c30e227c6f4c8f7474adbc1bb2 | [
"MIT"
] | null | null | null | import torch
from src.solver import BaseSolver
from src.asr import ASR
from src.optim import Optimizer
from src.data import load_dataset
from src.util import human_format, cal_er, feat_to_fig
class Solver(BaseSolver):
''' Solver for training'''
def __init__(self, config, paras, mode):
super().__init... | 44.472477 | 123 | 0.525529 | import torch
from src.solver import BaseSolver
from src.asr import ASR
from src.optim import Optimizer
from src.data import load_dataset
from src.util import human_format, cal_er, feat_to_fig
class Solver(BaseSolver):
def __init__(self, config, paras, mode):
super().__init__(config, paras, mode)
... | true | true |
f7fbb76b0773caa373dd69f082c9489291ff804d | 1,145 | py | Python | tests/fpga/vector_reduce_test.py | Walon1998/dace | 95ddfd3e9a5c654f0f0d66d026e0b64ec0f028a0 | [
"BSD-3-Clause"
] | 227 | 2019-03-15T23:39:06.000Z | 2022-03-30T07:49:08.000Z | tests/fpga/vector_reduce_test.py | Walon1998/dace | 95ddfd3e9a5c654f0f0d66d026e0b64ec0f028a0 | [
"BSD-3-Clause"
] | 834 | 2019-07-31T22:49:31.000Z | 2022-03-28T14:01:32.000Z | tests/fpga/vector_reduce_test.py | Walon1998/dace | 95ddfd3e9a5c654f0f0d66d026e0b64ec0f028a0 | [
"BSD-3-Clause"
] | 64 | 2019-03-19T05:40:37.000Z | 2022-03-11T15:02:42.000Z | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
""" Sums all the element of the vector with a reduce. """
import dace
import numpy as np
import argparse
from dace.fpga_testing import fpga_test
from dace.transformation.interstate import FPGATransformSDFG
N = dace.symbol('N')
@dace.program... | 21.603774 | 75 | 0.647162 |
import dace
import numpy as np
import argparse
from dace.fpga_testing import fpga_test
from dace.transformation.interstate import FPGATransformSDFG
N = dace.symbol('N')
@dace.program
def vector_reduce(x: dace.float32[N], s: dace.scalar(dace.float32)):
tmp = dace.define_local([N], dtype=x.dtype)
@dace... | true | true |
f7fbb7c3fd5f5fe51bd8a265fc65365f8aea2c10 | 210 | py | Python | File Extentions/File Extentions.py | RyanH7279/Code-Quest-Academy | 542d10edaa3b6c87d58df0dc4abeb6568e12237a | [
"Unlicense"
] | null | null | null | File Extentions/File Extentions.py | RyanH7279/Code-Quest-Academy | 542d10edaa3b6c87d58df0dc4abeb6568e12237a | [
"Unlicense"
] | null | null | null | File Extentions/File Extentions.py | RyanH7279/Code-Quest-Academy | 542d10edaa3b6c87d58df0dc4abeb6568e12237a | [
"Unlicense"
] | null | null | null | cases = int(input())
total = []
for case in range(cases):total.append(input().split(".")[1])
p = {}
for type in total: p[type] = total.count(type)
for key, value in p.items(): print(key + " " + str(value)) | 35 | 61 | 0.609524 | cases = int(input())
total = []
for case in range(cases):total.append(input().split(".")[1])
p = {}
for type in total: p[type] = total.count(type)
for key, value in p.items(): print(key + " " + str(value)) | true | true |
f7fbb82de6e8534437a1ad7b6238c51c30bad02d | 68,875 | py | Python | src/_nats/aio/client.py | charbonnierg/jetstream.py | 4d8dc56fc6953d0a28d207b9b162c6f8d0080d37 | [
"Apache-2.0"
] | 8 | 2021-07-26T10:54:10.000Z | 2021-12-06T08:41:02.000Z | src/_nats/aio/client.py | charbonnierg/jetstream.py | 4d8dc56fc6953d0a28d207b9b162c6f8d0080d37 | [
"Apache-2.0"
] | 3 | 2021-08-09T10:25:39.000Z | 2021-12-06T08:40:41.000Z | src/_nats/aio/client.py | charbonnierg/jetstream.py | 4d8dc56fc6953d0a28d207b9b162c6f8d0080d37 | [
"Apache-2.0"
] | 3 | 2021-08-22T01:55:11.000Z | 2021-09-13T13:51:42.000Z | # Copyright 2016-2021 The NATS 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 36.596706 | 128 | 0.573721 |
import asyncio
from asyncio.futures import Future
from asyncio.streams import StreamReader, StreamWriter
from asyncio.tasks import Task
import json
import time
import ssl
import ipaddress
import base64
import warnings
from random import shuffle
from urllib.parse import ParseResult, urlparse
import sys
imp... | true | true |
f7fbb94e5b23812820f8ad951984e63b5d24e2ad | 15,002 | py | Python | numpy/core/tests/test_deprecations.py | hmeine/numpy | ddd02d50e8cd06d84deecd3b2943813be20b91b8 | [
"BSD-3-Clause"
] | null | null | null | numpy/core/tests/test_deprecations.py | hmeine/numpy | ddd02d50e8cd06d84deecd3b2943813be20b91b8 | [
"BSD-3-Clause"
] | null | null | null | numpy/core/tests/test_deprecations.py | hmeine/numpy | ddd02d50e8cd06d84deecd3b2943813be20b91b8 | [
"BSD-3-Clause"
] | null | null | null | """
Tests related to deprecation warnings. Also a convenient place
to document how deprecations should eventually be turned into errors.
"""
from __future__ import division, absolute_import, print_function
import sys
import operator
import warnings
from nose.plugins.skip import SkipTest
import numpy as np
from numpy... | 40.436658 | 88 | 0.628716 | from __future__ import division, absolute_import, print_function
import sys
import operator
import warnings
from nose.plugins.skip import SkipTest
import numpy as np
from numpy.testing import (dec, run_module_suite, assert_raises,
assert_warns, assert_array_equal)
class _DeprecationTestCa... | true | true |
f7fbb988a634687215dee9a594a7dd08ba2137e7 | 6,347 | py | Python | dictionaries_examples.py | carlosmertens/Python-Introduction | 041b2ff1ad7acef7ad4a1016a5654ace4f33ac35 | [
"MIT"
] | null | null | null | dictionaries_examples.py | carlosmertens/Python-Introduction | 041b2ff1ad7acef7ad4a1016a5654ace4f33ac35 | [
"MIT"
] | null | null | null | dictionaries_examples.py | carlosmertens/Python-Introduction | 041b2ff1ad7acef7ad4a1016a5654ace4f33ac35 | [
"MIT"
] | null | null | null | """ DICTIONARIES
Rather than storing single objects like lists and sets do,
dictionaries store pairs of elements: keys and values.
Dictionary keys are similar to list indices: we can select elements
from the data structure by putting the index/key in square brackets.
Unlike lists, dictionaries can have keys of any im... | 36.0625 | 110 | 0.648653 |
from test_countries_list import country_list
# this is for Quiz 1
print("\n")
print("==================== Example 1 ====================\n")
# In this example we define a dictionary where the keys are element names and the values are
# their corresponding atomic numbers.
elements = {'hydrogen': 1, 'helium': 2, 'c... | true | true |
f7fbb9bc4d02c1939e17717a80e9b77248ab1fb9 | 9,841 | py | Python | paddlenlp/transformers/blenderbot_small/tokenizer.py | zzz2010/PaddleNLP | fba0b29601b0e8286a9ab860bf69c9acca4481f4 | [
"Apache-2.0"
] | 1 | 2022-01-17T02:11:58.000Z | 2022-01-17T02:11:58.000Z | paddlenlp/transformers/blenderbot_small/tokenizer.py | zzz2010/PaddleNLP | fba0b29601b0e8286a9ab860bf69c9acca4481f4 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/blenderbot_small/tokenizer.py | zzz2010/PaddleNLP | fba0b29601b0e8286a9ab860bf69c9acca4481f4 | [
"Apache-2.0"
] | null | null | null | # encoding=utf-8
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2021 The Facebook, Inc. and The HuggingFace Inc. team.
#
# 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 Licens... | 37.418251 | 115 | 0.552281 |
from ..gpt.tokenizer import GPTTokenizer
import re
__all__ = ['BlenderbotSmallTokenizer']
def get_pairs(word):
pairs = set()
prev_char = word[0]
for char in word[1:]:
pairs.add((prev_char, char))
prev_char = char
return pairs
class BlenderbotSmallTokenizer(GPTTokeni... | true | true |
f7fbb9d987769ea378cab29f1a1a71027622279b | 944 | py | Python | jpype/JClassUtil.py | marscher/jpype | ce359d7a0ff348831af8abd6e778ed4f7c52c81e | [
"Apache-2.0"
] | 6 | 2015-04-28T16:51:08.000Z | 2017-07-12T11:29:00.000Z | jpype/JClassUtil.py | donaldlab/jpype-py2 | 1b9850ad4ba4d3c14446a2c31d9c0bb1d4744076 | [
"Apache-2.0"
] | 29 | 2015-02-24T11:11:26.000Z | 2017-08-25T08:30:18.000Z | jpype/JClassUtil.py | donaldlab/jpype-py2 | 1b9850ad4ba4d3c14446a2c31d9c0bb1d4744076 | [
"Apache-2.0"
] | 2 | 2019-12-16T09:45:03.000Z | 2021-04-15T00:20:24.000Z | #*****************************************************************************
# Copyright 2004-2008 Steve Menard
#
# 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... | 37.76 | 79 | 0.579449 |
import _jclass
def isInterface(t) :
if not isinstance(t, _jclass._JavaClass) :
return False
return t.__javaclass__.isInterface()
| true | true |
f7fbb9e54d6b7f244e96b81874cc9dd0196bdc22 | 4,122 | py | Python | rasa/cli/run.py | GolemXlV/rasa-for-botfront | 35fa580993ab5d1b06defaa9bdcd45ca5ab04324 | [
"Apache-2.0"
] | null | null | null | rasa/cli/run.py | GolemXlV/rasa-for-botfront | 35fa580993ab5d1b06defaa9bdcd45ca5ab04324 | [
"Apache-2.0"
] | null | null | null | rasa/cli/run.py | GolemXlV/rasa-for-botfront | 35fa580993ab5d1b06defaa9bdcd45ca5ab04324 | [
"Apache-2.0"
] | 1 | 2020-03-12T16:09:06.000Z | 2020-03-12T16:09:06.000Z | import argparse
import logging
import os
from typing import List, Text
from rasa.cli.arguments import run as arguments
from rasa.cli.utils import get_validated_path, print_error
from rasa.constants import (
DEFAULT_ACTIONS_PATH,
DEFAULT_CREDENTIALS_PATH,
DEFAULT_ENDPOINTS_PATH,
DEFAULT_MODELS_PATH,
... | 30.992481 | 87 | 0.69966 | import argparse
import logging
import os
from typing import List, Text
from rasa.cli.arguments import run as arguments
from rasa.cli.utils import get_validated_path, print_error
from rasa.constants import (
DEFAULT_ACTIONS_PATH,
DEFAULT_CREDENTIALS_PATH,
DEFAULT_ENDPOINTS_PATH,
DEFAULT_MODELS_PATH,
... | true | true |
f7fbba6fe562f012c775b92d55e99ad97b599b17 | 6,631 | py | Python | scripts/xml2bom.py | nikhilantony28/cusf-kicad | 78f8d0be15db59c0c8e1e36f8c8176bb85810b8c | [
"MIT"
] | 24 | 2020-03-27T13:30:46.000Z | 2022-01-21T12:11:09.000Z | hardware/agg-kicad/scripts/xml2bom.py | g2545420172/ffp | fb29d1a506bc5a284d2de44264a1c483874066c4 | [
"Apache-2.0",
"MIT"
] | null | null | null | hardware/agg-kicad/scripts/xml2bom.py | g2545420172/ffp | fb29d1a506bc5a284d2de44264a1c483874066c4 | [
"Apache-2.0",
"MIT"
] | 9 | 2020-03-28T07:52:53.000Z | 2021-06-11T03:05:17.000Z | #!/usr/bin/env python
"""
xml2bom.py
Copyright 2015 Adam Greig
Licensed under the MIT licence, see LICENSE file for details.
Convert Farnell BOM XMLs to a useful text report, including sanity checking,
and outputting quickpaste formats for Farnell, RS and DigiKey.
"""
from __future__ import print_function, ... | 32.504902 | 79 | 0.582416 |
from __future__ import print_function, division
import os.path
import datetime
import argparse
import xml.etree.ElementTree as ET
parser = argparse.ArgumentParser(
prog='xml2bom',
description="Convert KiCAD EESchema XML BOMs to an expanded text format")
parser.add_argument("input", help="input file... | true | true |
f7fbbb5cfb10efcac3dcc39b47428d937d92ae88 | 1,581 | py | Python | tests/unit/__init__.py | dailymuse/musekafka-py | 3aec3d5ae620d5760733b2d9b73e9ac135dbd875 | [
"MIT"
] | 1 | 2020-11-10T22:15:49.000Z | 2020-11-10T22:15:49.000Z | tests/unit/__init__.py | dailymuse/musekafka-py | 3aec3d5ae620d5760733b2d9b73e9ac135dbd875 | [
"MIT"
] | 2 | 2020-11-13T16:32:49.000Z | 2020-11-17T05:36:31.000Z | tests/unit/__init__.py | dailymuse/musekafka-py | 3aec3d5ae620d5760733b2d9b73e9ac135dbd875 | [
"MIT"
] | null | null | null | import time
from typing import Any, Optional
def make_side_effect(messages, delay=None):
"""Make a side effect from a list of messages, optionally adding a delay."""
msg_queue = list(reversed(messages))
sleep_delay = delay
def side_effect(*args, **kwargs):
if sleep_delay is not None:
... | 26.79661 | 80 | 0.607211 | import time
from typing import Any, Optional
def make_side_effect(messages, delay=None):
msg_queue = list(reversed(messages))
sleep_delay = delay
def side_effect(*args, **kwargs):
if sleep_delay is not None:
time.sleep(sleep_delay)
return msg_queue.pop()
return side_effec... | true | true |
f7fbbb900dac51f1f50deeaf9cdae673108631e6 | 2,702 | py | Python | examples/2D/flight_conditions/expected_airfoil.py | SzymonSzyszko/AeroPy | b061c690e5926fdd834b7c50837c25108e908156 | [
"MIT"
] | 1 | 2020-07-23T00:15:00.000Z | 2020-07-23T00:15:00.000Z | examples/2D/flight_conditions/expected_airfoil.py | SzymonSzyszko/AeroPy | b061c690e5926fdd834b7c50837c25108e908156 | [
"MIT"
] | null | null | null | examples/2D/flight_conditions/expected_airfoil.py | SzymonSzyszko/AeroPy | b061c690e5926fdd834b7c50837c25108e908156 | [
"MIT"
] | null | null | null | import pickle
import numpy as np
import pandas as pd
import seaborn as sns
from scipy import interpolate
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.metrics import pairwise_distances_argmin_min
import aeropy.xfoil_module as xf
from aeropy.aero_module import Reynolds
from aeropy.geom... | 30.022222 | 88 | 0.668394 | import pickle
import numpy as np
import pandas as pd
import seaborn as sns
from scipy import interpolate
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.metrics import pairwise_distances_argmin_min
import aeropy.xfoil_module as xf
from aeropy.aero_module import Reynolds
from aeropy.geom... | true | true |
f7fbbcb5813cc1ca1e74c35f70d33ca552ff6fd7 | 585 | py | Python | src/python/playground/yaml2json.py | skitazaki/sandbox | abb807423430dd885ca12379d0f3dfafbfa56626 | [
"MIT"
] | 1 | 2015-09-05T14:02:10.000Z | 2015-09-05T14:02:10.000Z | src/python/playground/yaml2json.py | skitazaki/sandbox | abb807423430dd885ca12379d0f3dfafbfa56626 | [
"MIT"
] | null | null | null | src/python/playground/yaml2json.py | skitazaki/sandbox | abb807423430dd885ca12379d0f3dfafbfa56626 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Convert data format from YAML to JSON.
"""
import logging
import json
import click
import yaml
import yaml.scanner
from sandboxlib import main
@main.command("run")
@click.argument("file", type=click.File("r"), nargs=-1)
def yaml2json(file):
logger = logging.getLogger("")
for fh ... | 18.870968 | 55 | 0.623932 |
import logging
import json
import click
import yaml
import yaml.scanner
from sandboxlib import main
@main.command("run")
@click.argument("file", type=click.File("r"), nargs=-1)
def yaml2json(file):
logger = logging.getLogger("")
for fh in file:
try:
cfg = yaml.safe_load(fh)
ex... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.