hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c424e75e7b1b63aeb5f62a9876acbe97e1921a7 | 394 | py | Python | meet/management/commands/refresh_thumbnails.py | acaciawater/meetsite | 5008fe8aa333cdcf74df19cbe97fa490af4fcafd | [
"Apache-2.0"
] | null | null | null | meet/management/commands/refresh_thumbnails.py | acaciawater/meetsite | 5008fe8aa333cdcf74df19cbe97fa490af4fcafd | [
"Apache-2.0"
] | null | null | null | meet/management/commands/refresh_thumbnails.py | acaciawater/meetsite | 5008fe8aa333cdcf74df19cbe97fa490af4fcafd | [
"Apache-2.0"
] | null | null | null | '''
Created on Jan 27, 2017
@author: stephane
'''
from django.core.management.base import BaseCommand
from meet.models import Meetpunt
class Command(BaseCommand):
help = "Assign a meetpunt for each meting that does not have one"
def handle(self, *args, **options):
mps = Meetpunt.objects.all()
... | 23.176471 | 69 | 0.647208 | from django.core.management.base import BaseCommand
from meet.models import Meetpunt
class Command(BaseCommand):
help = "Assign a meetpunt for each meting that does not have one"
def handle(self, *args, **options):
mps = Meetpunt.objects.all()
for mp in mps:
mp.make_thumbnail(... | true | true |
1c424ea1b06d31a7f970e23a97cce3f2a8152949 | 59,549 | py | Python | tech_project/lib/python2.7/site-packages/pylint/lint.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 1 | 2019-10-16T07:56:31.000Z | 2019-10-16T07:56:31.000Z | tech_project/lib/python2.7/site-packages/pylint/lint.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 9 | 2019-12-04T23:15:54.000Z | 2022-02-10T11:05:43.000Z | tech_project/lib/python2.7/site-packages/pylint/lint.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 1 | 2021-07-28T20:35:14.000Z | 2021-07-28T20:35:14.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2006-2015 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2008 Fabrice Douchant <Fabrice.Douchant@logilab.fr>
# Copyright (c) 2009 Vincent
# Copyright (c) 2009 Mads Kiilerich <mads@kiilerich.com>
# Copyright (c) 2011-2014 Google, Inc.
# Copyright (c) 2012 David ... | 41.876934 | 99 | 0.556987 |
from __future__ import print_function
import collections
import contextlib
import operator
import os
try:
import multiprocessing
except ImportError:
multiprocessing = None
import sys
import tokenize
import warnings
import six
import astroid
from astroid.__pkginfo__ import v... | true | true |
1c424f68e1e50a13d66542614d95af7c28619862 | 5,135 | py | Python | Validation/RecoTrack/python/trackingNtuple_cff.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | 1 | 2020-08-12T08:37:04.000Z | 2020-08-12T08:37:04.000Z | Validation/RecoTrack/python/trackingNtuple_cff.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | Validation/RecoTrack/python/trackingNtuple_cff.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | 1 | 2019-03-19T13:44:54.000Z | 2019-03-19T13:44:54.000Z | import FWCore.ParameterSet.Config as cms
from RecoLocalTracker.Configuration.RecoLocalTracker_cff import *
from SimGeneral.TrackingAnalysis.simHitTPAssociation_cfi import *
from SimTracker.TrackerHitAssociation.tpClusterProducer_cfi import *
from SimTracker.TrackAssociatorProducers.quickTrackAssociatorByHits_cfi impor... | 43.888889 | 181 | 0.820837 | import FWCore.ParameterSet.Config as cms
from RecoLocalTracker.Configuration.RecoLocalTracker_cff import *
from SimGeneral.TrackingAnalysis.simHitTPAssociation_cfi import *
from SimTracker.TrackerHitAssociation.tpClusterProducer_cfi import *
from SimTracker.TrackAssociatorProducers.quickTrackAssociatorByHits_cfi impor... | true | true |
1c425048b7f3e854ac1d0a5ee45198dc6db9d2bb | 687 | py | Python | pycontour/fea/setup.py | PingjunChen/pycontour | 13f64b685740368605db314b0f547f9f8dd4e737 | [
"BSD-3-Clause"
] | 8 | 2018-08-30T13:13:48.000Z | 2021-07-24T08:49:35.000Z | pycontour/fea/setup.py | PingjunChen/pycontour | 13f64b685740368605db314b0f547f9f8dd4e737 | [
"BSD-3-Clause"
] | 1 | 2021-09-21T04:11:39.000Z | 2021-09-21T04:11:39.000Z | pycontour/fea/setup.py | PingjunChen/pycontour | 13f64b685740368605db314b0f547f9f8dd4e737 | [
"BSD-3-Clause"
] | 4 | 2018-09-21T20:38:26.000Z | 2021-09-17T21:45:37.000Z | # -*- coding: utf-8 -*-
import os
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
MODULE_NAME = os.path.basename(BASE_PATH)
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration(MODULE_NAME, parent_package, top_path)
retur... | 27.48 | 65 | 0.679767 |
import os
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
MODULE_NAME = os.path.basename(BASE_PATH)
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration(MODULE_NAME, parent_package, top_path)
return config
if __name__ ... | true | true |
1c425108a80a803a1e821cb6eb1a16b0511dbce8 | 223 | py | Python | python3/day_019/day-019-acquire_a_thread_lock-2.7.6.py | king-md/100DaysOfCode | ab2e2495e804663ca35f72bbc8d8ec06cb202fac | [
"MIT"
] | null | null | null | python3/day_019/day-019-acquire_a_thread_lock-2.7.6.py | king-md/100DaysOfCode | ab2e2495e804663ca35f72bbc8d8ec06cb202fac | [
"MIT"
] | null | null | null | python3/day_019/day-019-acquire_a_thread_lock-2.7.6.py | king-md/100DaysOfCode | ab2e2495e804663ca35f72bbc8d8ec06cb202fac | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
import threading, time
def takeANap():
time.sleep(5)
print('Wake up!')
print('Start of program.')
threadObj = threading.Thread(target=takeANap)
threadObj.start()
print('End of program.')
| 14.866667 | 45 | 0.695067 |
import threading, time
def takeANap():
time.sleep(5)
print('Wake up!')
print('Start of program.')
threadObj = threading.Thread(target=takeANap)
threadObj.start()
print('End of program.')
| true | true |
1c42529af57e0cf71cfef4106ffabcce7782fc6f | 2,258 | py | Python | ConverterValueEchchangePythonCourse/main.py | Sviatoslav-Lobanov/ConverterValueEchchangePythonCourse | 1862835c22d7bb9269d7ed7a6b3f704a49c16ce1 | [
"MIT"
] | null | null | null | ConverterValueEchchangePythonCourse/main.py | Sviatoslav-Lobanov/ConverterValueEchchangePythonCourse | 1862835c22d7bb9269d7ed7a6b3f704a49c16ce1 | [
"MIT"
] | null | null | null | ConverterValueEchchangePythonCourse/main.py | Sviatoslav-Lobanov/ConverterValueEchchangePythonCourse | 1862835c22d7bb9269d7ed7a6b3f704a49c16ce1 | [
"MIT"
] | null | null | null | import telebot
from config import keys, TOKEN
from extensions import *
bot = telebot.TeleBot(TOKEN)
# @bot.message_handler()
# def echo_test(message: telebot.types.Message):
# bot.send_message(message.chat.id, 'Привет')
@bot.message_handler(commands=['start','help'])
def help(message: telebot.types.Message):
... | 38.271186 | 137 | 0.649247 | import telebot
from config import keys, TOKEN
from extensions import *
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start','help'])
def help(message: telebot.types.Message):
text= 'Чтобы начать работу введите команду боту в следующем формате: \n <имя валюты> \
<в какую валюту первести> \... | true | true |
1c4252c046eb24dc133afc0a0de91116b45c5495 | 30,836 | py | Python | ckan/tests/test_coding_standards.py | GlobalMaksimum/ckan | bdba078d26d485e75554ba9570e292ec480eb9e4 | [
"Apache-2.0"
] | 1 | 2020-04-24T03:35:16.000Z | 2020-04-24T03:35:16.000Z | ckan/tests/test_coding_standards.py | GlobalMaksimum/ckan | bdba078d26d485e75554ba9570e292ec480eb9e4 | [
"Apache-2.0"
] | 7 | 2021-02-02T22:03:03.000Z | 2021-06-22T02:13:00.000Z | ckan/tests/test_coding_standards.py | GlobalMaksimum/ckan | bdba078d26d485e75554ba9570e292ec480eb9e4 | [
"Apache-2.0"
] | 3 | 2019-06-21T11:57:57.000Z | 2020-01-20T12:36:38.000Z | # encoding: utf-8
u'''A module for coding standards tests.
These are tests that are not functional- or unit-testing any particular piece
of CKAN code, but are checking coding standards. For example: checking that
there are no errors in the Sphinx build, that there are no PEP8 problems,
etc.
'''
import ast
import io... | 43.677054 | 85 | 0.70395 |
import ast
import io
import os
import os.path
import re
import subprocess
import sys
from six import text_type
from six.moves import xrange
FILESYSTEM_ENCODING = text_type(
sys.getfilesystemencoding() or sys.getdefaultencoding()
)
HERE = os.path.abspath(os.path.dirname(__file__.decode(FILESYSTEM_ENCODING)))
... | true | true |
1c42536e439f6f04c16663eefff72cc4898eaacc | 32,905 | py | Python | rule-based-agents/v4_1_avrdistance_rule.py | guocongyun/gfootball-competition | e922d8afbe41b346e894be2f2ad10434ae7ed56d | [
"MIT"
] | null | null | null | rule-based-agents/v4_1_avrdistance_rule.py | guocongyun/gfootball-competition | e922d8afbe41b346e894be2f2ad10434ae7ed56d | [
"MIT"
] | null | null | null | rule-based-agents/v4_1_avrdistance_rule.py | guocongyun/gfootball-competition | e922d8afbe41b346e894be2f2ad10434ae7ed56d | [
"MIT"
] | null | null | null | from kaggle_environments.envs.football.helpers import *
import math
import random
def find_patterns(obs, player_x, player_y):
""" find list of appropriate patterns in groups of memory patterns """
for get_group in groups_of_memory_patterns:
group = get_group(obs, player_x, player_y)
if group["e... | 43.013072 | 181 | 0.632123 | from kaggle_environments.envs.football.helpers import *
import math
import random
def find_patterns(obs, player_x, player_y):
for get_group in groups_of_memory_patterns:
group = get_group(obs, player_x, player_y)
if group["environment_fits"](obs, player_x, player_y):
return group["get_m... | true | true |
1c425380f5523969791e6ad7dabba1dbd1fdcea1 | 370 | py | Python | src/seirsplus/__init__.py | SEIRS-Plus/v2 | 3adc155400deaa4093e523ae81d2a25989888654 | [
"MIT"
] | 1 | 2022-03-04T08:05:58.000Z | 2022-03-04T08:05:58.000Z | src/seirsplus/__init__.py | SEIRS-Plus/v2 | 3adc155400deaa4093e523ae81d2a25989888654 | [
"MIT"
] | null | null | null | src/seirsplus/__init__.py | SEIRS-Plus/v2 | 3adc155400deaa4093e523ae81d2a25989888654 | [
"MIT"
] | null | null | null | # Standard Libraries
try:
from importlib import metadata
except ImportError:
# Try backported to PY<37 `importlib_metadata`.
import importlib_metadata as metadata
# Internal Libraries
from .dev_tools.logging_utils import _configure_seirsplus_loggers
_configure_seirsplus_loggers(root_module_name=__name__)
__versio... | 23.125 | 65 | 0.832432 |
try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata
from .dev_tools.logging_utils import _configure_seirsplus_loggers
_configure_seirsplus_loggers(root_module_name=__name__)
__version__ = metadata.version(__package__)
__all__ = []
| true | true |
1c4253d90edbc6466778a935a566ed598ee8df09 | 4,649 | py | Python | mainwindow/theme.py | philliphqs/Safey | a60a4f379083373c4615e51f09e70a4fd4e68ef3 | [
"MIT"
] | 2 | 2020-11-13T20:02:53.000Z | 2021-06-27T16:05:18.000Z | mainwindow/theme.py | philliphqs/Safey | a60a4f379083373c4615e51f09e70a4fd4e68ef3 | [
"MIT"
] | null | null | null | mainwindow/theme.py | philliphqs/Safey | a60a4f379083373c4615e51f09e70a4fd4e68ef3 | [
"MIT"
] | null | null | null | from dearpygui.core import *
from assets import properties
import json
def main():
set_main_window_title(f'{properties.ProductName}')
set_main_window_size(1308, 759)
def check_theme_on_startup():
with open('user/settings.hqs', 'r') as settings:
theme = json.load(settings)
if theme["theme"... | 41.141593 | 108 | 0.718434 | from dearpygui.core import *
from assets import properties
import json
def main():
set_main_window_title(f'{properties.ProductName}')
set_main_window_size(1308, 759)
def check_theme_on_startup():
with open('user/settings.hqs', 'r') as settings:
theme = json.load(settings)
if theme["theme"... | true | true |
1c4254c676ab2e70c68aeec16b48c70c687f05e7 | 397 | py | Python | PythonClub/PythonClub/wsgi.py | mmhansen137/itc172-redux | 155fffa57fc6b8db6a9b55c95d1a1458921b8aaa | [
"CC0-1.0"
] | null | null | null | PythonClub/PythonClub/wsgi.py | mmhansen137/itc172-redux | 155fffa57fc6b8db6a9b55c95d1a1458921b8aaa | [
"CC0-1.0"
] | null | null | null | PythonClub/PythonClub/wsgi.py | mmhansen137/itc172-redux | 155fffa57fc6b8db6a9b55c95d1a1458921b8aaa | [
"CC0-1.0"
] | null | null | null | """
WSGI config for PythonClub project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'PythonClub.settings')
application = get_wsgi_application()
| true | true |
1c4256799c51e59fbfabea4b7ab2f7ba3a5a7dfb | 13,764 | py | Python | micronet/compression/quantization/wqaq/iao/main.py | RiccardoRuggiero/micronet | bfdac2a50a5f0f8484a253b356c06a166bf7e6a0 | [
"MIT"
] | null | null | null | micronet/compression/quantization/wqaq/iao/main.py | RiccardoRuggiero/micronet | bfdac2a50a5f0f8484a253b356c06a166bf7e6a0 | [
"MIT"
] | null | null | null | micronet/compression/quantization/wqaq/iao/main.py | RiccardoRuggiero/micronet | bfdac2a50a5f0f8484a253b356c06a166bf7e6a0 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
sys.path.append("../../../..")
import math
import os
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms... | 40.60177 | 101 | 0.56873 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
sys.path.append("../../../..")
import math
import os
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms... | true | true |
1c4257770447c53571e0123f20816322805b5207 | 647 | py | Python | ansible_config.py | arista-netdevops-community/excel-to-avd | 8762697888b8d411eca65a5bd7e974f963e92956 | [
"Apache-2.0"
] | 1 | 2021-04-03T03:56:03.000Z | 2021-04-03T03:56:03.000Z | ansible_config.py | arista-netdevops-community/excel-to-avd | 8762697888b8d411eca65a5bd7e974f963e92956 | [
"Apache-2.0"
] | null | null | null | ansible_config.py | arista-netdevops-community/excel-to-avd | 8762697888b8d411eca65a5bd7e974f963e92956 | [
"Apache-2.0"
] | 1 | 2021-07-29T17:04:00.000Z | 2021-07-29T17:04:00.000Z | ansible_config = '''[defaults]
host_key_checking = False
inventory =./inventory.yml
gathering = explicit
retry_files_enabled = False
collections_paths = ./collections:./ansible_collections:~/.ansible/collections:/usr/share/ansible/collections:../../../ansible-avd/:../../../ansible-cvp/
jinja2_extensions = jinja2.ext.l... | 38.058824 | 153 | 0.789799 | ansible_config = '''[defaults]
host_key_checking = False
inventory =./inventory.yml
gathering = explicit
retry_files_enabled = False
collections_paths = ./collections:./ansible_collections:~/.ansible/collections:/usr/share/ansible/collections:../../../ansible-avd/:../../../ansible-cvp/
jinja2_extensions = jinja2.ext.l... | true | true |
1c4257a2308fbbdb3d1b76d4c2e28baa76179a6c | 233 | py | Python | Solutions/Solution_Problem_7.py | GuilhermeLouli/logic-python | 37193911c09d3362f2ee974f571dbb90ac62d26a | [
"MIT"
] | null | null | null | Solutions/Solution_Problem_7.py | GuilhermeLouli/logic-python | 37193911c09d3362f2ee974f571dbb90ac62d26a | [
"MIT"
] | null | null | null | Solutions/Solution_Problem_7.py | GuilhermeLouli/logic-python | 37193911c09d3362f2ee974f571dbb90ac62d26a | [
"MIT"
] | null | null | null | password = input("Senha: ")
for i in range(0, 9):
for j in range(0, 9):
for k in range(0, 9):
holder = str(i) + str(j) + str(k)
if holder == password:
print("A senha é: ", holder) | 25.888889 | 45 | 0.467811 | password = input("Senha: ")
for i in range(0, 9):
for j in range(0, 9):
for k in range(0, 9):
holder = str(i) + str(j) + str(k)
if holder == password:
print("A senha é: ", holder) | true | true |
1c42596d2a04ac274292a4823bdb5d679270cf98 | 229,676 | py | Python | salt/modules/file.py | Lesvek/salt | 6fbd8f66cb34bd5e0fcd6a8105ef0b17f19191ec | [
"Apache-2.0"
] | 2 | 2017-12-01T19:20:49.000Z | 2018-10-03T23:54:12.000Z | salt/modules/file.py | Lesvek/salt | 6fbd8f66cb34bd5e0fcd6a8105ef0b17f19191ec | [
"Apache-2.0"
] | null | null | null | salt/modules/file.py | Lesvek/salt | 6fbd8f66cb34bd5e0fcd6a8105ef0b17f19191ec | [
"Apache-2.0"
] | 1 | 2019-12-17T13:37:16.000Z | 2019-12-17T13:37:16.000Z | """
Manage information about regular files, directories,
and special files on the minion, set/read user,
group, mode, and data
"""
# TODO: We should add the capability to do u+r type operations here
# some time in the future
import datetime
import errno
import fnmatch
import glob
import hashlib
import itertools
impo... | 31.522921 | 178 | 0.560072 |
import datetime
import errno
import fnmatch
import glob
import hashlib
import itertools
import logging
import mmap
import operator
import os
import re
import shutil
import stat
import string
import sys
import tempfile
import time
import urllib.parse
from collections import namedtuple
from collections.abc import It... | true | true |
1c425a40a9b397cb0dd09cd767264aa4a99f84b9 | 1,467 | py | Python | python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding_diff_length_gloo.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 8 | 2016-08-15T07:02:27.000Z | 2016-08-24T09:34:00.000Z | python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding_diff_length_gloo.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 2 | 2019-07-26T04:06:05.000Z | 2019-07-29T04:25:24.000Z | python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding_diff_length_gloo.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 5 | 2021-12-10T11:20:06.000Z | 2022-02-18T05:18:12.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.212766 | 74 | 0.754601 |
from __future__ import print_function
import os
import sys
import unittest
import paddle.fluid as fluid
from test_dist_base import TestDistBase
from spawn_runner_base import TestDistSpawnRunner
from parallel_dygraph_sparse_embedding import TestSparseEmbedding
from parallel_dygraph_sparse_embedding_fp64 ... | true | true |
1c425c1bd579d9f50c7d9c87a59f22ab4798c088 | 21,137 | py | Python | vispy/visuals/image.py | asnt/vispy | e515b00de7086527070b3e51e1133f8c1c5ca165 | [
"BSD-3-Clause"
] | null | null | null | vispy/visuals/image.py | asnt/vispy | e515b00de7086527070b3e51e1133f8c1c5ca165 | [
"BSD-3-Clause"
] | null | null | null | vispy/visuals/image.py | asnt/vispy | e515b00de7086527070b3e51e1133f8c1c5ca165 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""Primitive 2D image visual class."""
from __future__ import division
import numpy as np
from ..gloo import Texture2D, VertexBuffer
from ..gloo.texture impor... | 37.812165 | 104 | 0.623646 |
from __future__ import division
import numpy as np
from ..gloo import Texture2D, VertexBuffer
from ..gloo.texture import should_cast_to_f32
from ..color import get_colormap
from .shaders import Function, FunctionChain
from .transforms import NullTransform
from .visual import Visual
from ..io import load_spatial_f... | true | true |
1c425c3ae9103d0ee23378f3a819544555a2ecab | 415 | py | Python | orders/migrations/0002_alter_order_shipping_total.py | IvanLezcano/TrabajoPracticoFinalPoloticDjango | 1a866e18c97e8836e96006a42be298ce201b052c | [
"CC0-1.0"
] | 1 | 2021-06-06T20:27:51.000Z | 2021-06-06T20:27:51.000Z | orders/migrations/0002_alter_order_shipping_total.py | IvanLezcano/TrabajoPracticoFinalPoloticDjango | 1a866e18c97e8836e96006a42be298ce201b052c | [
"CC0-1.0"
] | null | null | null | orders/migrations/0002_alter_order_shipping_total.py | IvanLezcano/TrabajoPracticoFinalPoloticDjango | 1a866e18c97e8836e96006a42be298ce201b052c | [
"CC0-1.0"
] | 1 | 2021-07-06T01:42:45.000Z | 2021-07-06T01:42:45.000Z | # Generated by Django 3.2.4 on 2021-06-11 16:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='order',
name='shipping_total',
... | 21.842105 | 84 | 0.612048 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='order',
name='shipping_total',
field=models.DecimalField(decimal_places=2... | true | true |
1c425c62bcad3f53bf5d215a797467396549f96b | 2,070 | py | Python | cryptocurrency/pump_and_dump/spike_checking/spike_checker.py | yzgastk/machine-learning-experiments | 63bf3af40f0273cd5b782deb7f5718c575ba5adf | [
"Apache-2.0"
] | null | null | null | cryptocurrency/pump_and_dump/spike_checking/spike_checker.py | yzgastk/machine-learning-experiments | 63bf3af40f0273cd5b782deb7f5718c575ba5adf | [
"Apache-2.0"
] | null | null | null | cryptocurrency/pump_and_dump/spike_checking/spike_checker.py | yzgastk/machine-learning-experiments | 63bf3af40f0273cd5b782deb7f5718c575ba5adf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3.8
# -*- coding: utf-8 -*-
import sys
import pickle as rick
import pandas as pd
import sqlite3 as s3
from numpy import mean
from numpy import std
from sklearn.model_selection import RepeatedStratifiedKFold, cross_val_score
from sklearn.metrics import roc_auc_score
from sklearn.metrics import confusi... | 46 | 156 | 0.665217 |
import sys
import pickle as rick
import pandas as pd
import sqlite3 as s3
from numpy import mean
from numpy import std
from sklearn.model_selection import RepeatedStratifiedKFold, cross_val_score
from sklearn.metrics import roc_auc_score
from sklearn.metrics import confusion_matrix
if __name__ == '__main__':
... | true | true |
1c425ccfcb659d3ab8f0cabfca4c81485097e1f3 | 588 | py | Python | PythonExercicios/ex050 - Soma dos Pares.py | caique-santana/CursoEmVideo-Curso_Python3 | 86bb67bbbf348544e1135d8657672d4e33fa70e2 | [
"MIT"
] | 1 | 2020-04-15T00:49:02.000Z | 2020-04-15T00:49:02.000Z | PythonExercicios/ex050 - Soma dos Pares.py | caique-santana/CursoEmVideo-Curso_Python3 | 86bb67bbbf348544e1135d8657672d4e33fa70e2 | [
"MIT"
] | null | null | null | PythonExercicios/ex050 - Soma dos Pares.py | caique-santana/CursoEmVideo-Curso_Python3 | 86bb67bbbf348544e1135d8657672d4e33fa70e2 | [
"MIT"
] | null | null | null | """Desenvolva um programa que leia seis números inteiros e mostre a soma apenas daqueles que forem pares.
Se o valor digitado for ímpar, desconsidere-o."""
# Meu
soma = 0
for c in range(1, 7):
num = int(input('Digite um número inteiro: '))
if num % 2 == 0:
soma += num
print('A soma dos números pares é {... | 29.4 | 105 | 0.622449 |
soma = 0
for c in range(1, 7):
num = int(input('Digite um número inteiro: '))
if num % 2 == 0:
soma += num
print('A soma dos números pares é {}.'.format(soma))
soma = 0
cont = 0
for c in range(1, 7):
num = int(input('Digite o {}ª valor: '.format(c)))
if num % 2 == 0:
soma += num
... | true | true |
1c425ce86751fdbcf4a521c0e7c71abb898bcc3e | 6,939 | py | Python | ask-smapi-model/ask_smapi_model/v1/skill/asr/evaluations/get_asr_evaluation_status_response_object.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | ask-smapi-model/ask_smapi_model/v1/skill/asr/evaluations/get_asr_evaluation_status_response_object.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | ask-smapi-model/ask_smapi_model/v1/skill/asr/evaluations/get_asr_evaluation_status_response_object.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 46.885135 | 261 | 0.696786 |
import pprint
import re
import six
import typing
from enum import Enum
from ask_smapi_model.v1.skill.asr.evaluations.evaluation_metadata import EvaluationMetadata
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union
from datetime import datetime
from ask_smapi_model.v1.... | true | true |
1c425f9604c3c2b74d9702ddc73276507f561f0f | 28,746 | py | Python | pegasus/tools/visualization.py | hoondy/pegasus | ca6e8dc3b39402deab21d6db80ad4ce8d41631e9 | [
"BSD-3-Clause"
] | null | null | null | pegasus/tools/visualization.py | hoondy/pegasus | ca6e8dc3b39402deab21d6db80ad4ce8d41631e9 | [
"BSD-3-Clause"
] | null | null | null | pegasus/tools/visualization.py | hoondy/pegasus | ca6e8dc3b39402deab21d6db80ad4ce8d41631e9 | [
"BSD-3-Clause"
] | null | null | null | import time
import numpy as np
import scipy
import umap as umap_module
import forceatlas2 as fa2
import uuid
from threadpoolctl import threadpool_limits
from pegasusio import MultimodalData
from pegasus.tools import (
eff_n_jobs,
update_rep,
X_from_rep,
W_from_rep,
get_neighbors,
neighbors,
... | 32.408117 | 168 | 0.634245 | import time
import numpy as np
import scipy
import umap as umap_module
import forceatlas2 as fa2
import uuid
from threadpoolctl import threadpool_limits
from pegasusio import MultimodalData
from pegasus.tools import (
eff_n_jobs,
update_rep,
X_from_rep,
W_from_rep,
get_neighbors,
neighbors,
... | true | true |
1c4260852b0f621da5efbc981c92c14d38f9bbe8 | 1,469 | py | Python | src/UQpy/distributions/collection/__init__.py | SURGroup/UncertaintyQuantification | a94c8db47d07134ea2b3b0a3ca53ca818532c3e6 | [
"MIT"
] | null | null | null | src/UQpy/distributions/collection/__init__.py | SURGroup/UncertaintyQuantification | a94c8db47d07134ea2b3b0a3ca53ca818532c3e6 | [
"MIT"
] | null | null | null | src/UQpy/distributions/collection/__init__.py | SURGroup/UncertaintyQuantification | a94c8db47d07134ea2b3b0a3ca53ca818532c3e6 | [
"MIT"
] | null | null | null | """distributions module."""
from UQpy.distributions.collection.Beta import Beta
from UQpy.distributions.collection.Binomial import Binomial
from UQpy.distributions.collection.Cauchy import Cauchy
from UQpy.distributions.collection.ChiSquare import ChiSquare
from UQpy.distributions.collection.Exponential import Exponent... | 58.76 | 79 | 0.884275 | from UQpy.distributions.collection.Beta import Beta
from UQpy.distributions.collection.Binomial import Binomial
from UQpy.distributions.collection.Cauchy import Cauchy
from UQpy.distributions.collection.ChiSquare import ChiSquare
from UQpy.distributions.collection.Exponential import Exponential
from UQpy.distributions.... | true | true |
1c4261909a6125c4b24deccef4cdfb6b92d5f694 | 6,127 | py | Python | torchgeo/trainers/regression.py | remtav/torchgeo | d06b103f81edec4f4e0d13ccd621d318364679a2 | [
"MIT"
] | null | null | null | torchgeo/trainers/regression.py | remtav/torchgeo | d06b103f81edec4f4e0d13ccd621d318364679a2 | [
"MIT"
] | null | null | null | torchgeo/trainers/regression.py | remtav/torchgeo | d06b103f81edec4f4e0d13ccd621d318364679a2 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Regression tasks."""
from typing import Any, Dict, cast
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from torch.nn.modules import Conv2d, Line... | 32.94086 | 112 | 0.598498 |
from typing import Any, Dict, cast
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from torch.nn.modules import Conv2d, Linear
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torchmetrics import MeanAbsoluteError, MeanSquaredErr... | true | true |
1c42620eeadd924a4985cdcf2ca0e88b6096d381 | 20,007 | py | Python | cudaDistanceMatrix/cudaDistanceMatrix.py | greenmonn/distanceMatrixGPU | b06d9309ff6bf5e950a1f9384e58b47665a9b22e | [
"MIT"
] | 2 | 2021-05-25T14:51:42.000Z | 2021-12-20T11:11:40.000Z | cudaDistanceMatrix/cudaDistanceMatrix.py | greenmonn/distanceMatrixGPU | b06d9309ff6bf5e950a1f9384e58b47665a9b22e | [
"MIT"
] | null | null | null | cudaDistanceMatrix/cudaDistanceMatrix.py | greenmonn/distanceMatrixGPU | b06d9309ff6bf5e950a1f9384e58b47665a9b22e | [
"MIT"
] | null | null | null | import h5py
import numpy as np
from skcuda import linalg, misc
import pycuda.autoinit
from pycuda.compiler import SourceModule
import pycuda.gpuarray as gpuarray
linalg.init()
from numpy.linalg import norm
import os.path
cuda_driver = pycuda.driver.init()
pycuda.driver.Device(0).retain_primary_context()
from .fillArr... | 33.124172 | 237 | 0.503924 | import h5py
import numpy as np
from skcuda import linalg, misc
import pycuda.autoinit
from pycuda.compiler import SourceModule
import pycuda.gpuarray as gpuarray
linalg.init()
from numpy.linalg import norm
import os.path
cuda_driver = pycuda.driver.init()
pycuda.driver.Device(0).retain_primary_context()
from .fillArr... | true | true |
1c4262ae70c0755a3ef735a93e550cc742de16a6 | 535 | py | Python | test/testincar.py | DropD/parsevasp | 05e2b04abd381e92b14d91218bdce2edb5529437 | [
"MIT"
] | null | null | null | test/testincar.py | DropD/parsevasp | 05e2b04abd381e92b14d91218bdce2edb5529437 | [
"MIT"
] | null | null | null | test/testincar.py | DropD/parsevasp | 05e2b04abd381e92b14d91218bdce2edb5529437 | [
"MIT"
] | 1 | 2018-07-19T09:17:31.000Z | 2018-07-19T09:17:31.000Z | #!/usr/bin/python
import sys
import io
import os
import logging
testdir = os.path.dirname(__file__)
srcdir = '../parsevasp'
sys.path.insert(0, os.path.abspath(os.path.join(testdir, srcdir)))
import incar
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('Testing')
incar = incar.Incar(file_path = tes... | 22.291667 | 66 | 0.723364 |
import sys
import io
import os
import logging
testdir = os.path.dirname(__file__)
srcdir = '../parsevasp'
sys.path.insert(0, os.path.abspath(os.path.join(testdir, srcdir)))
import incar
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('Testing')
incar = incar.Incar(file_path = testdir + "/INCAR")
... | false | true |
1c4262cdeb92ebd6c335d957cdc8fd8bfca03129 | 190 | py | Python | Learning Python/Exercise Files/Ch2/helloworld_my.py | RomanShevtsiv/linkedin-learning | d7ec85953b7e88905f87928ede067d32344b984f | [
"MIT"
] | null | null | null | Learning Python/Exercise Files/Ch2/helloworld_my.py | RomanShevtsiv/linkedin-learning | d7ec85953b7e88905f87928ede067d32344b984f | [
"MIT"
] | null | null | null | Learning Python/Exercise Files/Ch2/helloworld_my.py | RomanShevtsiv/linkedin-learning | d7ec85953b7e88905f87928ede067d32344b984f | [
"MIT"
] | null | null | null | #
# Example file for HelloWorld
#
def main():
print("Hello World")
name = input("What is your name? ")
print("Nice to meet you,", name)
if __name__ == "__main__":
main()
| 13.571429 | 39 | 0.594737 |
def main():
print("Hello World")
name = input("What is your name? ")
print("Nice to meet you,", name)
if __name__ == "__main__":
main()
| true | true |
1c426315e61989e059c3795bd0347b919c2187d5 | 2,365 | py | Python | openGaussBase/testcase/SECURITY/PERMISSIONS/Opengauss_Function_Security_Authentication_Case0006.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SECURITY/PERMISSIONS/Opengauss_Function_Security_Authentication_Case0006.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SECURITY/PERMISSIONS/Opengauss_Function_Security_Authentication_Case0006.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 34.779412 | 84 | 0.649894 |
import unittest
from yat.test import Node
from yat.test import macro
from testcase.utils.Common import Common
from testcase.utils.CommonSH import CommonSH
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
logger = Logger()
class Policy(unittest.TestCase):
def setUp(self):
... | true | true |
1c4263adea94853f60b5eafdb904b7159d01f84a | 365 | py | Python | app/decorators.py | mildock/KakaotalkHost | cf110e5f4675852d032972c0da57c21e6f3b56b6 | [
"MIT"
] | null | null | null | app/decorators.py | mildock/KakaotalkHost | cf110e5f4675852d032972c0da57c21e6f3b56b6 | [
"MIT"
] | null | null | null | app/decorators.py | mildock/KakaotalkHost | cf110e5f4675852d032972c0da57c21e6f3b56b6 | [
"MIT"
] | null | null | null | from time import time
from functools import wraps
def processtime(func):
'''
콘솔에서 함수의 실행시간을 디버깅하는 용도입니다.
'''
@wraps(func)
def wrapper(*args, **kwargs):
start = time()
result = func(*args, **kwargs)
during = time() - start
print(">>", func.__name__, ">> %.5fs" % duri... | 21.470588 | 55 | 0.564384 | from time import time
from functools import wraps
def processtime(func):
@wraps(func)
def wrapper(*args, **kwargs):
start = time()
result = func(*args, **kwargs)
during = time() - start
print(">>", func.__name__, ">> %.5fs" % during)
return result
return wrapper
| true | true |
1c426483c131a2f228d4fb9f7f0f8a73a3ca5d0d | 420 | py | Python | Text.py | nvakhilnair/Image-Encryption-and-Decryption-using-RSA | 6a033aac703acd4d9f3f2f32faa2c79ad3c31600 | [
"MIT"
] | null | null | null | Text.py | nvakhilnair/Image-Encryption-and-Decryption-using-RSA | 6a033aac703acd4d9f3f2f32faa2c79ad3c31600 | [
"MIT"
] | null | null | null | Text.py | nvakhilnair/Image-Encryption-and-Decryption-using-RSA | 6a033aac703acd4d9f3f2f32faa2c79ad3c31600 | [
"MIT"
] | null | null | null | from decrypt import decrpytion
def text_process(input_Dir,d,N):
with open(input_Dir) as f:
line = f.readline()
f.close()
line = line[1:len(line)-1]
line_list = list(line.split(","))
data_ciphered = []
for i in line_list:
data_ciphered.append(int(i))
data_deciphered = []
... | 28 | 49 | 0.645238 | from decrypt import decrpytion
def text_process(input_Dir,d,N):
with open(input_Dir) as f:
line = f.readline()
f.close()
line = line[1:len(line)-1]
line_list = list(line.split(","))
data_ciphered = []
for i in line_list:
data_ciphered.append(int(i))
data_deciphered = []
... | true | true |
1c4264913c5b765b683a7fbcf3168ec8a3de824a | 809 | py | Python | src/league_py/api/decorators.py | cguethle/league_py | 58e0ad35e62260bdf019a21707531132557567ba | [
"MIT"
] | null | null | null | src/league_py/api/decorators.py | cguethle/league_py | 58e0ad35e62260bdf019a21707531132557567ba | [
"MIT"
] | null | null | null | src/league_py/api/decorators.py | cguethle/league_py | 58e0ad35e62260bdf019a21707531132557567ba | [
"MIT"
] | null | null | null | """ Helper decorators for LOL API calls.
"""
import functools
from league_py.api import get_region
class LolApi(object):
""" Helper to facilitate building of the api urls for use by the basic api methods.
"""
version = None
name = None
def __init__(self, url):
self.url = url
def __ca... | 26.966667 | 87 | 0.577256 | import functools
from league_py.api import get_region
class LolApi(object):
version = None
name = None
def __init__(self, url):
self.url = url
def __call__(self, fnc):
@functools.wraps(fnc)
def decorated(*args, **kwargs):
url_pattern = "/api/lol/{region}/v{version... | true | true |
1c4264f1b535bdcffc4958e6c8c5f249ac98dd37 | 1,741 | py | Python | tests/components/demo/test_lock.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-10-23T14:39:11.000Z | 2021-02-17T14:40:17.000Z | tests/components/demo/test_lock.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | tests/components/demo/test_lock.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 6 | 2020-04-10T06:21:11.000Z | 2021-07-01T08:53:38.000Z | """The tests for the Demo lock platform."""
import unittest
from homeassistant.setup import setup_component
from homeassistant.components import lock
from tests.common import get_test_home_assistant, mock_service
from tests.components.lock import common
FRONT = "lock.front_door"
KITCHEN = "lock.kitchen_door"
OPENABL... | 31.654545 | 86 | 0.669156 | import unittest
from homeassistant.setup import setup_component
from homeassistant.components import lock
from tests.common import get_test_home_assistant, mock_service
from tests.components.lock import common
FRONT = "lock.front_door"
KITCHEN = "lock.kitchen_door"
OPENABLE_LOCK = "lock.openable_lock"
class TestLo... | true | true |
1c42654c426217406ee4f4c9016b8326fa90948d | 88,057 | py | Python | tests/hwsim/test_p2p_messages.py | AstroProfundis/hostap | f4830bed661f4adff51f50a0d37c64ceb748e780 | [
"Unlicense"
] | null | null | null | tests/hwsim/test_p2p_messages.py | AstroProfundis/hostap | f4830bed661f4adff51f50a0d37c64ceb748e780 | [
"Unlicense"
] | null | null | null | tests/hwsim/test_p2p_messages.py | AstroProfundis/hostap | f4830bed661f4adff51f50a0d37c64ceb748e780 | [
"Unlicense"
] | null | null | null | # P2P protocol tests for various messages
# Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import struct
import time
import logging
logger = logging.getLogger()
import hostapd
from p2p_utils impor... | 42.253839 | 161 | 0.6624 |
import binascii
import struct
import time
import logging
logger = logging.getLogger()
import hostapd
from p2p_utils import *
from test_gas import anqp_adv_proto
def ie_ssid(ssid):
return struct.pack("<BB", WLAN_EID_SSID, len(ssid)) + ssid
def ie_supp_rates():
return struct.pack("<BBBBBBBBBB", WLAN_EID_... | false | true |
1c4265b4bcea0102a286800f0e08177217b2a2ef | 1,432 | py | Python | clocq/knowledge_base/creation/csv_to_clocq/transform_json_to_pickle.py | PhilippChr/CLOCQ | b74eea30a30e20b4e9c46908b5385b1eafb2ba53 | [
"MIT"
] | 8 | 2021-12-06T13:35:27.000Z | 2021-12-27T09:46:29.000Z | clocq/knowledge_base/creation/csv_to_clocq/transform_json_to_pickle.py | PhilippChr/CLOCQ | b74eea30a30e20b4e9c46908b5385b1eafb2ba53 | [
"MIT"
] | 3 | 2022-01-22T14:06:51.000Z | 2022-03-16T01:36:29.000Z | clocq/knowledge_base/creation/csv_to_clocq/transform_json_to_pickle.py | PhilippChr/CLOCQ | b74eea30a30e20b4e9c46908b5385b1eafb2ba53 | [
"MIT"
] | 2 | 2021-12-06T13:35:31.000Z | 2021-12-21T06:36:26.000Z | import json
import pickle
import re
HIGHEST_ID = 92114576
ENT_PATTERN = re.compile('^Q[0-9]+$')
PRE_PATTERN = re.compile('^P[0-9]+$')
with open("dicts/entity_nodes.pickle", "rb") as infile:
entities_dict = pickle.load(infile)
with open("dicts/pred_nodes.pickle", "rb") as infile:
predicates_dict = pickle.load(infil... | 26.518519 | 84 | 0.73743 | import json
import pickle
import re
HIGHEST_ID = 92114576
ENT_PATTERN = re.compile('^Q[0-9]+$')
PRE_PATTERN = re.compile('^P[0-9]+$')
with open("dicts/entity_nodes.pickle", "rb") as infile:
entities_dict = pickle.load(infile)
with open("dicts/pred_nodes.pickle", "rb") as infile:
predicates_dict = pickle.load(infil... | true | true |
1c4266aff4dac39120705746b9a9fdfcd5e41f20 | 1,305 | py | Python | src/config.py | R6M9/b | 12f1a17b8a053d87ad342c53639f6a832ed7a165 | [
"MIT"
] | 1 | 2022-03-05T13:34:59.000Z | 2022-03-05T13:34:59.000Z | src/config.py | melek-saidani/bypass_utility | 3320fb9fb34ae5cff64a51ab4358663baa72a425 | [
"MIT"
] | null | null | null | src/config.py | melek-saidani/bypass_utility | 3320fb9fb34ae5cff64a51ab4358663baa72a425 | [
"MIT"
] | 1 | 2021-08-29T00:53:40.000Z | 2021-08-29T00:53:40.000Z | import json5
class Config:
watchdog_address: int = 0x10007000
uart_base: int = 0x11002000
payload_address: int = 0x100A00
var_0: int = None
var_1: int = 0xA
payload: str
crash_method: int = 0
def default(self, hw_code):
config = open("default_config.json5")
self.from_f... | 24.166667 | 88 | 0.595402 | import json5
class Config:
watchdog_address: int = 0x10007000
uart_base: int = 0x11002000
payload_address: int = 0x100A00
var_0: int = None
var_1: int = 0xA
payload: str
crash_method: int = 0
def default(self, hw_code):
config = open("default_config.json5")
self.from_f... | true | true |
1c42675f32f5b19737a76c62da34641547830ea1 | 3,951 | py | Python | pythonCodes/linearRegression.py | cansuyildiz/DataMiningLibraryForSparklingWaterPlatform | 0fda4ab40c7613eead313f36374b53923e2357f7 | [
"MIT"
] | 1 | 2020-07-28T12:12:53.000Z | 2020-07-28T12:12:53.000Z | pythonCodes/linearRegression.py | cansuyildiz/DataMiningLibraryForSparklingWaterPlatform | 0fda4ab40c7613eead313f36374b53923e2357f7 | [
"MIT"
] | null | null | null | pythonCodes/linearRegression.py | cansuyildiz/DataMiningLibraryForSparklingWaterPlatform | 0fda4ab40c7613eead313f36374b53923e2357f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 04 10:40:37 2018
@author: cansu.yildiz
"""
from __future__ import print_function
import argparse
import h2o
import findspark
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
from pyspark import SparkConf, SparkContext
from pysparkling import *
... | 32.652893 | 248 | 0.639079 |
from __future__ import print_function
import argparse
import h2o
import findspark
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
from pyspark import SparkConf, SparkContext
from pysparkling import *
from pyspark.sql import SparkSession
from math import sqrt
import time
from functools impor... | true | true |
1c42690c2a2fe99f458ebf9b3e0400676b59b534 | 162 | py | Python | tests/functions/sort_cmp.py | treeform/pystorm | 3a2224bcdaccc5a2abf6a820c0bcf7afa3e6fed4 | [
"MIT"
] | 50 | 2015-03-24T19:45:34.000Z | 2022-02-20T04:34:26.000Z | tests/functions/sort_cmp.py | MoonStarCZW/py2js | 6cda2b1d3cf281a5ca92c18b08ac9fa1c389cbea | [
"MIT"
] | 2 | 2017-02-26T09:43:07.000Z | 2017-03-06T20:04:24.000Z | tests/functions/sort_cmp.py | Slater-Victoroff/pyjaco | 89c4e3c46399c5023b0e160005d855a01241c58a | [
"MIT"
] | 12 | 2016-03-07T09:30:49.000Z | 2021-09-05T20:38:47.000Z |
def revcmp(a,b):
if b<a:
return -1
if b==a:
return 0
return 1
l = [4,7,2,3,8,1,3]
l.sort(revcmp)
print l[0]
print l[1]
print l[2]
| 10.125 | 19 | 0.493827 |
def revcmp(a,b):
if b<a:
return -1
if b==a:
return 0
return 1
l = [4,7,2,3,8,1,3]
l.sort(revcmp)
print l[0]
print l[1]
print l[2]
| false | true |
1c4269d1ac5c3a06e4a302c3ed7f1afbf85326c2 | 4,528 | py | Python | TPCh11.py | MrOrioleCashback/snippets | 2dc7e4539009ab57b0f069e2d68908bc943d687a | [
"MIT"
] | null | null | null | TPCh11.py | MrOrioleCashback/snippets | 2dc7e4539009ab57b0f069e2d68908bc943d687a | [
"MIT"
] | null | null | null | TPCh11.py | MrOrioleCashback/snippets | 2dc7e4539009ab57b0f069e2d68908bc943d687a | [
"MIT"
] | null | null | null | list1 = ['a', 'b', 'c', 'd', 'e', 'f']
list2 = [1, 2, 3, 4, 5, 6]
list3 = 'bananna'
my_dict = dict([(x, y) for x, y in zip(list1, list2)])
my_dict['g'] = 7
#print(my_dict) #unordered
#print('a' in my_dict) #indexed by key
#print(1 in my_dict) #only keys
#print(1 in my_dict.values()) #use .values... | 21.258216 | 90 | 0.563163 | list1 = ['a', 'b', 'c', 'd', 'e', 'f']
list2 = [1, 2, 3, 4, 5, 6]
list3 = 'bananna'
my_dict = dict([(x, y) for x, y in zip(list1, list2)])
my_dict['g'] = 7
ter in string:
if character not in temp_dict:
temp_dict[character] = 1
else:
temp_dict[character] += 1
r... | true | true |
1c4269d277bffd065a07c442e015bebcb400301c | 4,100 | py | Python | samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py | sensorario/openapi-generator | bf68e9b7d2d9a27fab481fe6bab3f57bc135b94c | [
"Apache-2.0"
] | 1 | 2022-01-24T08:22:21.000Z | 2022-01-24T08:22:21.000Z | samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py | sensorario/openapi-generator | bf68e9b7d2d9a27fab481fe6bab3f57bc135b94c | [
"Apache-2.0"
] | 4 | 2021-09-29T08:46:32.000Z | 2021-12-08T09:07:04.000Z | samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py | sensorario/openapi-generator | bf68e9b7d2d9a27fab481fe6bab3f57bc135b94c | [
"Apache-2.0"
] | 1 | 2022-02-24T15:54:44.000Z | 2022-02-24T15:54:44.000Z | # coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
from dataclasses import dataclass
import re # noqa: F401
import sys # noqa: F401
import typing
import urllib3
from petstore_api import api_client, exceptions
import decimal # noqa: F401
from datetime import date, datetime # noqa: F401
fro... | 24.404762 | 103 | 0.680488 |
from dataclasses import dataclass
import re
import sys
import typing
import urllib3
from petstore_api import api_client, exceptions
import decimal
from datetime import date, datetime
from frozendict import frozendict
from petstore_api.schemas import (
AnyTypeSchema,
ComposedSchema,
DictSche... | true | true |
1c426a1bd83479239c465bb66b269e18f73bcea5 | 6,421 | py | Python | emat/database/sqlite/callback.py | jinsanity07git/tmip-emat | ff816cf50f141825078bb276d6da46d92c5028a9 | [
"BSD-3-Clause"
] | 13 | 2019-03-26T13:27:43.000Z | 2022-02-02T18:30:36.000Z | emat/database/sqlite/callback.py | jinsanity07git/tmip-emat | ff816cf50f141825078bb276d6da46d92c5028a9 | [
"BSD-3-Clause"
] | 19 | 2019-04-24T20:58:10.000Z | 2020-09-11T22:31:06.000Z | emat/database/sqlite/callback.py | jinsanity07git/tmip-emat | ff816cf50f141825078bb276d6da46d92c5028a9 | [
"BSD-3-Clause"
] | 17 | 2019-02-19T16:13:52.000Z | 2022-02-14T20:50:36.000Z |
import pandas as pd
import numpy as np
from ...workbench import RealParameter, IntegerParameter, BooleanParameter, CategoricalParameter
from ...workbench.em_framework.callbacks import AbstractCallback
from ...workbench.util.ema_exceptions import EMAError
from ...util.loggers import get_module_logger
from ..._pkg_con... | 34.896739 | 124 | 0.566267 |
import pandas as pd
import numpy as np
from ...workbench import RealParameter, IntegerParameter, BooleanParameter, CategoricalParameter
from ...workbench.em_framework.callbacks import AbstractCallback
from ...workbench.util.ema_exceptions import EMAError
from ...util.loggers import get_module_logger
from ..._pkg_con... | true | true |
1c426b551914d9e9e32db31584539aaa94f1c500 | 1,119 | py | Python | python/phonenumbers/data/region_KM.py | vishnuku/python-phonenumbers | 6ac2cdd06b7ccf709a8efb21629cf2c5f030e627 | [
"Apache-2.0"
] | 3 | 2018-12-02T23:09:00.000Z | 2018-12-02T23:16:59.000Z | python/phonenumbers/data/region_KM.py | carljm/python-phonenumbers | 494044aaf75443dbfd62b8d1352b441af6a458ae | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/data/region_KM.py | carljm/python-phonenumbers | 494044aaf75443dbfd62b8d1352b441af6a458ae | [
"Apache-2.0"
] | null | null | null | """Auto-generated file, do not edit by hand. KM metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_KM = PhoneMetadata(id='KM', country_code=269, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[3478]\\d{6}', possible_number_pattern='... | 62.166667 | 167 | 0.730116 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_KM = PhoneMetadata(id='KM', country_code=269, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[3478]\\d{6}', possible_number_pattern='\\d{7}', possible_length=(7,)),
fixed_line=PhoneNumberDe... | true | true |
1c426d4046389b146362310306a9cc103065da7a | 399 | py | Python | 96. Unique Binary Search Trees.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | 96. Unique Binary Search Trees.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | 96. Unique Binary Search Trees.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | class Solution:
def numTrees(self, n: int) -> int:
dp = [0] * (n+1)
dp[0], dp[1] = 1, 1
for i in range(2, n+1):
for j in range(1, i+1):
dp [i] += dp[j-1] * dp[i-j]
return dp[n]
class Solution:
def numTrees(self, n: int) -> int:
C = 1
... | 24.9375 | 43 | 0.411028 | class Solution:
def numTrees(self, n: int) -> int:
dp = [0] * (n+1)
dp[0], dp[1] = 1, 1
for i in range(2, n+1):
for j in range(1, i+1):
dp [i] += dp[j-1] * dp[i-j]
return dp[n]
class Solution:
def numTrees(self, n: int) -> int:
C = 1
... | true | true |
1c426e79980c532222fc25ad8d44e96babb574fc | 3,126 | py | Python | CALLC/trainl2.py | RobbinBouwmeester/CALLC_evaluation | 0125ed88b767c305261cf5731c671f890bfacadd | [
"Apache-2.0"
] | 2 | 2020-01-23T09:51:37.000Z | 2020-04-23T00:28:16.000Z | CALLC/trainl2.py | RobbinBouwmeester/CALLC_evaluation | 0125ed88b767c305261cf5731c671f890bfacadd | [
"Apache-2.0"
] | null | null | null | CALLC/trainl2.py | RobbinBouwmeester/CALLC_evaluation | 0125ed88b767c305261cf5731c671f890bfacadd | [
"Apache-2.0"
] | null | null | null | """
Robbin Bouwmeester
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribute... | 31.26 | 132 | 0.713692 |
import subprocess
import pandas as pd
def call_ghostbusters(infile_known="temp/tempKnownsl2.csv",infile_unknown="temp/tempUnknownsl2.csv",fold_list="temp/tempFolds.txt"):
cmd = "Rscript makeGAM.R %s %s %s" % (infile_known,infile_unknown,fold_list)
print("Going to execute this command: ",cmd)
p = subproces... | true | true |
1c4271422b7611b9a21c7152230960baf2a01abd | 4,371 | py | Python | homeassistant/components/logbook/queries/entities_and_devices.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/logbook/queries/entities_and_devices.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 2 | 2021-09-18T03:56:30.000Z | 2022-03-17T13:07:51.000Z | homeassistant/components/logbook/queries/entities_and_devices.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | null | null | null | """Entities and Devices queries for logbook."""
from __future__ import annotations
from collections.abc import Iterable
from datetime import datetime as dt
import sqlalchemy
from sqlalchemy import lambda_stmt, select, union_all
from sqlalchemy.orm import Query
from sqlalchemy.sql.lambdas import StatementLambdaElement... | 35.25 | 93 | 0.715626 | from __future__ import annotations
from collections.abc import Iterable
from datetime import datetime as dt
import sqlalchemy
from sqlalchemy import lambda_stmt, select, union_all
from sqlalchemy.orm import Query
from sqlalchemy.sql.lambdas import StatementLambdaElement
from sqlalchemy.sql.selectable import CTE, Comp... | true | true |
1c4271641131b9b76624ace443ad9d870b03b26b | 17,129 | py | Python | worktime.py | knilch0r/worktime | f9b8c733f868a59deb94b60d8aea917b58fb4cb9 | [
"MIT"
] | null | null | null | worktime.py | knilch0r/worktime | f9b8c733f868a59deb94b60d8aea917b58fb4cb9 | [
"MIT"
] | null | null | null | worktime.py | knilch0r/worktime | f9b8c733f868a59deb94b60d8aea917b58fb4cb9 | [
"MIT"
] | 1 | 2020-06-15T12:36:01.000Z | 2020-06-15T12:36:01.000Z | #!/usr/bin/python
import sys
import json
import csv
import os
import copy
import json
import argparse
from datetime import datetime
from datetime import timedelta
from dateutil import parser as date_parser
try:
# Mac OS only
import Quartz
except ImportError:
# Windows
import ctypes
SCRIPT_PATH = os.path.dirnam... | 31.257299 | 161 | 0.693619 |
import sys
import json
import csv
import os
import copy
import json
import argparse
from datetime import datetime
from datetime import timedelta
from dateutil import parser as date_parser
try:
import Quartz
except ImportError:
import ctypes
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
class Co... | true | true |
1c427247b13e3398f7417f8893567113ea48d937 | 550 | py | Python | wikivir/app/migrations/0002_auto_20190507_0126.py | ALivingVendingMachine/wikivir | f642a91523653de54ac94735f9cf6e9160696c56 | [
"MIT"
] | null | null | null | wikivir/app/migrations/0002_auto_20190507_0126.py | ALivingVendingMachine/wikivir | f642a91523653de54ac94735f9cf6e9160696c56 | [
"MIT"
] | null | null | null | wikivir/app/migrations/0002_auto_20190507_0126.py | ALivingVendingMachine/wikivir | f642a91523653de54ac94735f9cf6e9160696c56 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-05-07 01:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='malwaresample',
name='objdump',
... | 22.916667 | 55 | 0.581818 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='malwaresample',
name='objdump',
field=models.CharField(max_length=2560000),
... | true | true |
1c4272abf69356a8b1677f56657114f8b8c9d484 | 11,241 | py | Python | huaweicloud-sdk-cbr/huaweicloudsdkcbr/v1/model/op_extend_info_replication.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-cbr/huaweicloudsdkcbr/v1/model/op_extend_info_replication.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-cbr/huaweicloudsdkcbr/v1/model/op_extend_info_replication.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class OpExtendInfoReplication:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): Th... | 31.844193 | 286 | 0.663731 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class OpExtendInfoReplication:
sensitive_list = []
openapi_types = {
'destination_backup_id': 'str',
'destination_checkpoint_id': 'str',
'destination_project_id': 'str',
'de... | true | true |
1c427478f97891dc6bc4fc30bf1182bc4ef3b923 | 1,895 | py | Python | examples/vpc/v1/port.py | allenLew1991/huaweicloud-sdk-python | 13d1931372ee096ac3065251c48db16ef6c045c9 | [
"Apache-2.0"
] | 1 | 2019-11-12T07:44:16.000Z | 2019-11-12T07:44:16.000Z | examples/vpc/v1/port.py | ArvinSong/huaweicloud-sdk-python | 227cd7f68a07974b16794c371f110d1927571fd0 | [
"Apache-2.0"
] | null | null | null | examples/vpc/v1/port.py | ArvinSong/huaweicloud-sdk-python | 227cd7f68a07974b16794c371f110d1927571fd0 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# 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... | 24.934211 | 82 | 0.700264 |
import os
from openstack import connection
auth_url = '******'
userDomainId = '******'
projectId = '******'
username = '******'
password = os.getenv('get_secret_code')
conn = connection.Connection(
auth_url=auth_url,
user_domain_id=userDomainId,
project_id=projectId,
username=username,
... | true | true |
1c42756ae3f5204c2d9f241ef62016ce02c92a72 | 1,908 | py | Python | tone.py | Gredelston/johann | 2c85238ad603987686d2d6c7be6abe806b963e02 | [
"MIT"
] | 2 | 2019-06-19T14:09:09.000Z | 2019-06-19T14:21:05.000Z | tone.py | Gredelston/johann | 2c85238ad603987686d2d6c7be6abe806b963e02 | [
"MIT"
] | 1 | 2019-06-19T02:18:34.000Z | 2019-06-19T02:18:34.000Z | tone.py | Gredelston/johann | 2c85238ad603987686d2d6c7be6abe806b963e02 | [
"MIT"
] | null | null | null | MIDI_NUMBERS = {
'C2': 36,
'B#2': 36,
'C#2': 37,
'Db2': 37,
'D2': 38,
'D#2': 39,
'Eb2': 39,
'E2': 40,
'Fb2': 40,
'F2': 41,
'E#2': 41,
'F#2': 42,
'Gb2': 42,
'G2': 43,
'G#2': 44,
'Ab2': 44,
'A2': 45,
'A#2': 46,
'Bb2': 46,
... | 23.268293 | 76 | 0.602725 | MIDI_NUMBERS = {
'C2': 36,
'B#2': 36,
'C#2': 37,
'Db2': 37,
'D2': 38,
'D#2': 39,
'Eb2': 39,
'E2': 40,
'Fb2': 40,
'F2': 41,
'E#2': 41,
'F#2': 42,
'Gb2': 42,
'G2': 43,
'G#2': 44,
'Ab2': 44,
'A2': 45,
'A#2': 46,
'Bb2': 46,
... | true | true |
1c4275b9df928d2e1f149027cd822f0ac311e8b2 | 2,028 | py | Python | src/tests/thesis/sto_xe_plot_ET.py | certik/hfsolver | b4c50c1979fb7e468b1852b144ba756f5a51788d | [
"BSD-2-Clause"
] | 20 | 2015-03-24T13:06:39.000Z | 2022-03-29T00:14:02.000Z | src/tests/thesis/sto_xe_plot_ET.py | certik/hfsolver | b4c50c1979fb7e468b1852b144ba756f5a51788d | [
"BSD-2-Clause"
] | 6 | 2015-03-25T04:59:43.000Z | 2017-06-06T23:00:09.000Z | src/tests/thesis/sto_xe_plot_ET.py | certik/hfsolver | b4c50c1979fb7e468b1852b144ba756f5a51788d | [
"BSD-2-Clause"
] | 5 | 2016-01-20T13:38:22.000Z | 2020-11-24T15:35:43.000Z | from numpy import loadtxt, average, empty, array, shape, transpose, size
from pylab import semilogy, savefig, legend, title, grid, xlabel, ylabel, plot
def get_differences(data):
assert data.shape[1] == 2
x = data[:, 0]
y = data[:, 1]
diffs = abs(y[1:] - y[:-1])
return diffs
def guess_convergence(... | 28.56338 | 115 | 0.582347 | from numpy import loadtxt, average, empty, array, shape, transpose, size
from pylab import semilogy, savefig, legend, title, grid, xlabel, ylabel, plot
def get_differences(data):
assert data.shape[1] == 2
x = data[:, 0]
y = data[:, 1]
diffs = abs(y[1:] - y[:-1])
return diffs
def guess_convergence(... | false | true |
1c42760a4b46ae1882ca453c7be6b790b10b0c88 | 1,023 | py | Python | python3.4Smartforest/lib/python3.4/site-packages/django/http/utils.py | letouriste001/SmartForest_2.0 | 109b78bf1e8c8404800f377ab969395ccbb617be | [
"MIT"
] | null | null | null | python3.4Smartforest/lib/python3.4/site-packages/django/http/utils.py | letouriste001/SmartForest_2.0 | 109b78bf1e8c8404800f377ab969395ccbb617be | [
"MIT"
] | null | null | null | python3.4Smartforest/lib/python3.4/site-packages/django/http/utils.py | letouriste001/SmartForest_2.0 | 109b78bf1e8c8404800f377ab969395ccbb617be | [
"MIT"
] | null | null | null | """
Functions that modify an HTTP request or response in some way.
"""
# This group of functions are run as part of the response handling, after
# everything else, including all response middleware. Think of them as
# "compulsory response middleware". Be careful about what goes here, because
# it's a little fiddly to ... | 1,023 | 1,023 | 0.675464 | true | true | |
1c4276d0c4945e82034c9eb915df6333caeacd86 | 1,042 | py | Python | docs/examples/cors_rest_server.py | rob-blackbourn/bareasgi | c83e3020edcb5e1650b6137c21d7f3659467e687 | [
"Apache-2.0"
] | 15 | 2019-02-23T11:09:06.000Z | 2020-01-01T09:25:33.000Z | docs/examples/cors_rest_server.py | rob-blackbourn/bareASGI | 5966ab6b54bc99420b06fb90cff05d15447e98b7 | [
"Apache-2.0"
] | 1 | 2021-09-20T10:55:49.000Z | 2021-09-20T10:55:49.000Z | docs/examples/cors_rest_server.py | rob-blackbourn/bareasgi | c83e3020edcb5e1650b6137c21d7f3659467e687 | [
"Apache-2.0"
] | 1 | 2021-01-11T09:09:29.000Z | 2021-01-11T09:09:29.000Z | """CORS REST server"""
import json
import logging
from bareasgi import (
Application,
HttpRequest,
HttpResponse,
text_reader,
text_writer
)
from bareasgi_cors import CORSMiddleware
logging.basicConfig(level=logging.DEBUG)
async def get_info(request: HttpRequest) -> HttpResponse:
"""GET hand... | 20.84 | 63 | 0.659309 |
import json
import logging
from bareasgi import (
Application,
HttpRequest,
HttpResponse,
text_reader,
text_writer
)
from bareasgi_cors import CORSMiddleware
logging.basicConfig(level=logging.DEBUG)
async def get_info(request: HttpRequest) -> HttpResponse:
text = json.dumps(request.info)
... | true | true |
1c4277779a0006e73024bd536ca755198ff017a2 | 2,434 | py | Python | tests/test_cifti_vis_recon_all.py | lgrennan/ciftify | 8488423bd081370614b676a2e1d1a8dbfd9aba1c | [
"MIT"
] | null | null | null | tests/test_cifti_vis_recon_all.py | lgrennan/ciftify | 8488423bd081370614b676a2e1d1a8dbfd9aba1c | [
"MIT"
] | null | null | null | tests/test_cifti_vis_recon_all.py | lgrennan/ciftify | 8488423bd081370614b676a2e1d1a8dbfd9aba1c | [
"MIT"
] | null | null | null | import unittest
import logging
import importlib
import random
from mock import patch, MagicMock, mock_open
from nose.tools import raises
recon = importlib.import_module('ciftify.bin.cifti_vis_recon_all')
logging.disable(logging.CRITICAL)
class TestUserSettings(unittest.TestCase):
@raises(SystemExit)
def te... | 34.771429 | 74 | 0.67954 | import unittest
import logging
import importlib
import random
from mock import patch, MagicMock, mock_open
from nose.tools import raises
recon = importlib.import_module('ciftify.bin.cifti_vis_recon_all')
logging.disable(logging.CRITICAL)
class TestUserSettings(unittest.TestCase):
@raises(SystemExit)
def te... | true | true |
1c4278254d38a54507753c51c7f075a29ccdb76d | 761 | py | Python | textattack/constraints/overlap/levenshtein_edit_distance.py | fighting41love/TextAttack | 24e48f0022dc3a7bdcd5cbb3430f1c72cfcb522d | [
"MIT"
] | 2 | 2020-07-08T08:55:37.000Z | 2020-09-03T00:57:38.000Z | textattack/constraints/overlap/levenshtein_edit_distance.py | fighting41love/TextAttack | 24e48f0022dc3a7bdcd5cbb3430f1c72cfcb522d | [
"MIT"
] | null | null | null | textattack/constraints/overlap/levenshtein_edit_distance.py | fighting41love/TextAttack | 24e48f0022dc3a7bdcd5cbb3430f1c72cfcb522d | [
"MIT"
] | null | null | null | import editdistance
from textattack.constraints import Constraint
class LevenshteinEditDistance(Constraint):
""" A constraint on edit distance (Levenshtein Distance).
"""
def __init__(self, max_edit_distance):
if not isinstance(max_edit_distance, int):
raise TypeError('max_edit_di... | 33.086957 | 84 | 0.704336 | import editdistance
from textattack.constraints import Constraint
class LevenshteinEditDistance(Constraint):
def __init__(self, max_edit_distance):
if not isinstance(max_edit_distance, int):
raise TypeError('max_edit_distance must be an int')
self.max_edit_distance = max_edit_dist... | true | true |
1c427830e6cb82adabfc919a96e8b7c6985a9f0c | 2,943 | py | Python | pystiche/image/transforms/functional/_crop.py | sourcery-ai-bot/pystiche | 57bc6cfd074d47e8ad98a4f6e570b92ce37131bc | [
"BSD-3-Clause"
] | null | null | null | pystiche/image/transforms/functional/_crop.py | sourcery-ai-bot/pystiche | 57bc6cfd074d47e8ad98a4f6e570b92ce37131bc | [
"BSD-3-Clause"
] | null | null | null | pystiche/image/transforms/functional/_crop.py | sourcery-ai-bot/pystiche | 57bc6cfd074d47e8ad98a4f6e570b92ce37131bc | [
"BSD-3-Clause"
] | null | null | null | from typing import Tuple, Union, cast
import torch
from pystiche.image.utils import (
extract_image_size,
force_batched_image,
is_edge_size,
is_image_size,
)
from pystiche.misc import verify_str_arg
__all__ = [
"crop",
"top_left_crop",
"bottom_left_crop",
"top_right_crop",
"bottom... | 28.298077 | 87 | 0.646279 | from typing import Tuple, Union, cast
import torch
from pystiche.image.utils import (
extract_image_size,
force_batched_image,
is_edge_size,
is_image_size,
)
from pystiche.misc import verify_str_arg
__all__ = [
"crop",
"top_left_crop",
"bottom_left_crop",
"top_right_crop",
"bottom... | true | true |
1c4279bd3f0aba85457a2b68efce65dc3e1e88d8 | 248 | py | Python | text/combilex.py | dan-wells/FastSpeech2 | 5a3b18a5abced0909b6192cbf75aa90e1c2b3141 | [
"MIT"
] | null | null | null | text/combilex.py | dan-wells/FastSpeech2 | 5a3b18a5abced0909b6192cbf75aa90e1c2b3141 | [
"MIT"
] | null | null | null | text/combilex.py | dan-wells/FastSpeech2 | 5a3b18a5abced0909b6192cbf75aa90e1c2b3141 | [
"MIT"
] | null | null | null | valid_symbols = [
'3', '5', '@', 'A', 'D', 'E', 'I', 'N', 'O', 'S', 'T', 'U', 'V', 'Z',
'a', 'b', 'd', 'dZ', 'e', 'e~', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'l=',
'm', 'm=', 'n', 'n=', 'o~', 'p', 'r', 's', 't', 'tS', 'u', 'v', 'w', 'z'
]
| 41.333333 | 76 | 0.225806 | valid_symbols = [
'3', '5', '@', 'A', 'D', 'E', 'I', 'N', 'O', 'S', 'T', 'U', 'V', 'Z',
'a', 'b', 'd', 'dZ', 'e', 'e~', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'l=',
'm', 'm=', 'n', 'n=', 'o~', 'p', 'r', 's', 't', 'tS', 'u', 'v', 'w', 'z'
]
| true | true |
1c4279f080c7b2a4d74637ea2ab486b9984af5d2 | 2,808 | py | Python | vitrage-4.3.1/vitrage/tests/unit/common/test_utils.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 89 | 2015-09-30T21:42:17.000Z | 2022-03-28T16:31:19.000Z | vitrage-4.3.1/vitrage/tests/unit/common/test_utils.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | vitrage-4.3.1/vitrage/tests/unit/common/test_utils.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 43 | 2015-11-04T15:54:27.000Z | 2021-12-10T14:24:03.000Z | # Copyright 2016 - Alcatel-Lucent
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 39 | 77 | 0.656695 |
import itertools
from vitrage.common import utils
from vitrage.tests import base
from vitrage.tests.base import IsEmpty
class UtilsTest(base.BaseTest):
def _assert_set_equal(self, s1, s2, message):
self.assert_dict_equal(dict.fromkeys(s1, 0),
dict.fromkeys(s2,... | true | true |
1c427c528ea8c95efada7e9ee342ac634c701320 | 5,867 | py | Python | pcapparser/packet_parser.py | sangyf/pcap-parser | 933b792d6588c7eb5c6a270f989748dc8b3c1d61 | [
"BSD-3-Clause"
] | 1 | 2021-02-23T03:35:34.000Z | 2021-02-23T03:35:34.000Z | pcapparser/packet_parser.py | sangyf/pcap-parser | 933b792d6588c7eb5c6a270f989748dc8b3c1d61 | [
"BSD-3-Clause"
] | null | null | null | pcapparser/packet_parser.py | sangyf/pcap-parser | 933b792d6588c7eb5c6a270f989748dc8b3c1d61 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals, print_function, division
__author__ = 'dongliu'
import struct
import socket
from pcapparser.constant import *
class TcpPack:
""" a tcp packet, header fields and data. """
def __init__(self, source, source_port, dest, dest_port, flags, seq, ack_seq, body):
se... | 34.110465 | 102 | 0.654508 | from __future__ import unicode_literals, print_function, division
__author__ = 'dongliu'
import struct
import socket
from pcapparser.constant import *
class TcpPack:
def __init__(self, source, source_port, dest, dest_port, flags, seq, ack_seq, body):
self.source = source
self.source_port = sour... | true | true |
1c427e093c9dfbef2750930fa240588794cddfc7 | 6,603 | py | Python | tensorflow/vocab.py | swyjay/MRC | 47b0baeaa1544dbf4d763471692c508cb32ec93d | [
"Apache-2.0"
] | 1 | 2021-04-19T18:02:40.000Z | 2021-04-19T18:02:40.000Z | tensorflow/vocab.py | swyjay/MRC | 47b0baeaa1544dbf4d763471692c508cb32ec93d | [
"Apache-2.0"
] | null | null | null | tensorflow/vocab.py | swyjay/MRC | 47b0baeaa1544dbf4d763471692c508cb32ec93d | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf8 -*-
# ==============================================================================
# Copyright 2017 Baidu.com, Inc. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of th... | 33.517766 | 97 | 0.566712 |
import numpy as np
class Vocab(object):
def __init__(self, filename=None, initial_tokens=None, lower=False):
self.id2token = {}
self.token2id = {}
self.token_cnt = {}
self.lower = lower
self.embed_dim = None
self.embeddings = None
self.pad... | true | true |
1c427ea8b340360aec22c298b306b66233fa109d | 1,103 | py | Python | tests/test_frame.py | himbeles/geo3d | b9a01868207e9f2c0364eb3a6c130c9304cde0b6 | [
"MIT"
] | 4 | 2020-05-07T18:57:07.000Z | 2021-06-07T02:34:16.000Z | tests/test_frame.py | himbeles/geo3d | b9a01868207e9f2c0364eb3a6c130c9304cde0b6 | [
"MIT"
] | 2 | 2021-02-10T07:37:40.000Z | 2021-02-10T09:31:37.000Z | tests/test_frame.py | himbeles/geo3d | b9a01868207e9f2c0364eb3a6c130c9304cde0b6 | [
"MIT"
] | null | null | null | import pytest
from numpy import sqrt
from geo3d import (
Frame,
frame_wizard,
Point,
Vector,
UnitFrame,
RotationMatrix,
transformation_between_frames,
)
def test_frame_wizard():
t = frame_wizard([0, 0, 1], [0, 1, 0], "z", "y", [0, 0, 0])
assert t == UnitFrame
def test_manual_fr... | 26.902439 | 78 | 0.673617 | import pytest
from numpy import sqrt
from geo3d import (
Frame,
frame_wizard,
Point,
Vector,
UnitFrame,
RotationMatrix,
transformation_between_frames,
)
def test_frame_wizard():
t = frame_wizard([0, 0, 1], [0, 1, 0], "z", "y", [0, 0, 0])
assert t == UnitFrame
def test_manual_fr... | true | true |
1c427edf5196c86b0a41c355033c91731f7d3999 | 1,413 | py | Python | heknasa/nasa_dec.py | Alpha-Demon404/RE-14 | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 39 | 2020-02-26T09:44:36.000Z | 2022-03-23T00:18:25.000Z | heknasa/nasa_dec.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 15 | 2020-05-14T10:07:26.000Z | 2022-01-06T02:55:32.000Z | heknasa/nasa_dec.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 41 | 2020-03-16T22:36:38.000Z | 2022-03-17T14:47:19.000Z | # uncompyle6 version 3.6.2
# Python bytecode 2.7
# Decompiled from: Python 2.7.17 (default, Oct 23 2019, 08:25:46)
# [GCC 4.2.1 Compatible Android (5220042 based on r346389c) Clang 8.0.7 (https://
# Embedded file name: <default>
import os, sys, time
normal = '\x1b[0;39m'
logo = "\n\x1b[92m ___ ___ __ ... | 47.1 | 563 | 0.53574 |
import os, sys, time
normal = '\x1b[0;39m'
logo = "\n\x1b[92m ___ ___ __ __ \n\x1b[92m | Y .-----| |--. .-----.---.-.-----.---.-.|__.--.--.\n\x1b[92m |. 1 | -__| < | | _ |__ --| _ | __| | |\n\x1b[92m |. _ |_____|__|__| |__|__|___._|_____|... | false | true |
1c4283124f120be686eb14d6792903d15ec1e39e | 5,637 | py | Python | pyglet-hg/pyglet/gl/glu_info.py | sangh/LaserShow | abc95e465e3455dc220cc602dd58358c84666f29 | [
"BSD-3-Clause"
] | 2 | 2017-05-10T08:27:22.000Z | 2019-10-05T14:55:00.000Z | pyglet/GL/glu_info.py | seeminglee/pyglet64 | 3dd167b5b0d3ad132a157e404586e53c2bb21736 | [
"BSD-3-Clause"
] | null | null | null | pyglet/GL/glu_info.py | seeminglee/pyglet64 | 3dd167b5b0d3ad132a157e404586e53c2bb21736 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | 35.012422 | 78 | 0.659038 |
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from ctypes import *
import warnings
from pyglet.gl.glu import *
class GLUInfo(object):
have_context = False
version = '0.0.0'
extensions = []
_have_info = False
def set_active_context(self):
self... | true | true |
1c4283e833a86ce40a8d18bb9afcf660fc39bd7c | 36,879 | py | Python | electrum/address_synchronizer.py | bitspill/flo-electrum-1 | 5975c105d682719d5d8aad50b80e795fc7cfbf9d | [
"MIT"
] | null | null | null | electrum/address_synchronizer.py | bitspill/flo-electrum-1 | 5975c105d682719d5d8aad50b80e795fc7cfbf9d | [
"MIT"
] | 1 | 2018-09-10T18:45:13.000Z | 2018-09-10T18:45:13.000Z | electrum/address_synchronizer.py | bitspill/flo-electrum-1 | 5975c105d682719d5d8aad50b80e795fc7cfbf9d | [
"MIT"
] | 1 | 2018-07-14T08:17:34.000Z | 2018-07-14T08:17:34.000Z | # Electrum - lightweight Bitcoin client
# Copyright (C) 2018 The Electrum Developers
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the ... | 42.003417 | 109 | 0.569809 |
import threading
import asyncio
import itertools
from collections import defaultdict
from typing import TYPE_CHECKING, Dict, Optional
from . import bitcoin
from .bitcoin import COINBASE_MATURITY, TYPE_ADDRESS, TYPE_PUBKEY
from .util import PrintError, profiler, bfh, TxMinedInfo
from .transaction... | true | true |
1c4283ea17546442c7e578c2a51d2bd4b6ed76e0 | 2,080 | bzl | Python | rules/autogen.bzl | GregAC/opentitan | 40b607b776d7b10cfc2899cc0d724d00dc0c91a2 | [
"Apache-2.0"
] | 1 | 2021-11-29T14:56:50.000Z | 2021-11-29T14:56:50.000Z | rules/autogen.bzl | GregAC/opentitan | 40b607b776d7b10cfc2899cc0d724d00dc0c91a2 | [
"Apache-2.0"
] | null | null | null | rules/autogen.bzl | GregAC/opentitan | 40b607b776d7b10cfc2899cc0d724d00dc0c91a2 | [
"Apache-2.0"
] | null | null | null | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""Autogeneration rules for OpenTitan.
The rules in this file are for autogenerating various file resources
used by the OpenTitan build, such as register definition files ... | 30.588235 | 86 | 0.608173 |
def _hjson_header(ctx):
header = ctx.actions.declare_file("{}.h".format(ctx.label.name))
ctx.actions.run(
outputs = [header],
inputs = ctx.files.srcs + ctx.files._tool,
arguments = [
"-D",
"-o",
header.path,
] + [src.path for src in ctx.fi... | true | true |
1c4285d039fa87dc0c7b7b34e87c167d6c330c37 | 39,015 | py | Python | src/sage/rings/fraction_field.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | 1 | 2020-08-30T04:27:27.000Z | 2020-08-30T04:27:27.000Z | src/sage/rings/fraction_field.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | null | null | null | src/sage/rings/fraction_field.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | 1 | 2020-07-23T10:40:14.000Z | 2020-07-23T10:40:14.000Z | # -*- coding: utf-8 -*-
r"""
Fraction Field of Integral Domains
AUTHORS:
- William Stein (with input from David Joyner, David Kohel, and Joe
Wetherell)
- Burcin Erocal
- Julian Rüth (2017-06-27): embedding into the field of fractions and its
section
EXAMPLES:
Quotienting is a constructor for an element of the... | 30.480469 | 142 | 0.528976 |
from __future__ import absolute_import
from six.moves import range
import six
from . import ring
from . import fraction_field_element
import sage.misc.latex as latex
from sage.misc.cachefunc import cached_method
from sage.rings.integer_ring import ZZ
from sage.structure.richcmp import richcmp
from sage.... | true | true |
1c4286d1bec411fe939dc034241b702c6929d4c7 | 333 | py | Python | examples/ipython_extensions/my_system/extension.py | nixocio/manage | ced0ce7fe6aff05cb0f0d8d1a37d5fdfaace1d55 | [
"ISC"
] | 111 | 2016-06-14T03:21:36.000Z | 2019-07-19T16:48:26.000Z | examples/ipython_extensions/my_system/extension.py | nixocio/manage | ced0ce7fe6aff05cb0f0d8d1a37d5fdfaace1d55 | [
"ISC"
] | 14 | 2016-06-23T03:09:32.000Z | 2017-10-11T00:38:15.000Z | examples/ipython_extensions/my_system/extension.py | nixocio/manage | ced0ce7fe6aff05cb0f0d8d1a37d5fdfaace1d55 | [
"ISC"
] | 12 | 2016-06-26T18:56:35.000Z | 2019-04-28T08:19:56.000Z | # coding: utf-8
import IPython.core.error
def shutdown_hook(ipython):
print('\nThis is an extension exit hook')
raise IPython.core.error.TryNext
def load_ipython_extension(ipython):
print('\nExtension is being loaded!')
print(ipython)
ipython.set_hook('shutdown_hook', shutdown_hook, _warn_depre... | 22.2 | 76 | 0.744745 |
import IPython.core.error
def shutdown_hook(ipython):
print('\nThis is an extension exit hook')
raise IPython.core.error.TryNext
def load_ipython_extension(ipython):
print('\nExtension is being loaded!')
print(ipython)
ipython.set_hook('shutdown_hook', shutdown_hook, _warn_deprecated=False)
| true | true |
1c4286dc73c971e2e33bea18a4ca19da4a639cd8 | 16 | py | Python | btd6_memory_info/generated/System/Enum/enum.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/System/Enum/enum.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/System/Enum/enum.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class Enum: pass | 16 | 16 | 0.8125 | class Enum: pass | true | true |
1c42876ca9960da64105a1ab05d91e42a1d00a17 | 921 | py | Python | spider_learn/scrapy_learn/mySpider/mySpider/spiders/cast.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | spider_learn/scrapy_learn/mySpider/mySpider/spiders/cast.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | spider_learn/scrapy_learn/mySpider/mySpider/spiders/cast.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
from scrapy_learn.mySpider.mySpider.items import CastItem
class CastSpider(scrapy.Spider):
name = 'cast'
allowed_domains = ['cast.cn']
start_urls = ['http://cast.cn/']
# 1. 负责解析返回的网页数据,提取结构化数据(生成item)
# 2. 生成下一页的URL请求
def parse(self, response):
#f... | 28.78125 | 61 | 0.543974 |
import scrapy
from scrapy_learn.mySpider.mySpider.items import CastItem
class CastSpider(scrapy.Spider):
name = 'cast'
allowed_domains = ['cast.cn']
start_urls = ['http://cast.cn/']
def parse(self, response):
items = []
for each in response.xpath("//div[@c... | true | true |
1c42881d1d279e5163eb221403b46e7740fa6127 | 275 | py | Python | supportbot/supportbot/doctype/conversation_log/test_conversation_log.py | deepshig/supportbot | 252fa5d56d5ebbff296a84585bbde05c3b549999 | [
"MIT"
] | 1 | 2021-04-18T22:08:37.000Z | 2021-04-18T22:08:37.000Z | supportbot/supportbot/doctype/conversation_log/test_conversation_log.py | deepshig/supportbot | 252fa5d56d5ebbff296a84585bbde05c3b549999 | [
"MIT"
] | null | null | null | supportbot/supportbot/doctype/conversation_log/test_conversation_log.py | deepshig/supportbot | 252fa5d56d5ebbff296a84585bbde05c3b549999 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('conversation_log')
class Testconversation_log(unittest.TestCase):
pass
| 21.153846 | 60 | 0.781818 |
from __future__ import unicode_literals
import frappe
import unittest
class Testconversation_log(unittest.TestCase):
pass
| true | true |
1c42886a320fe961c8578ac295c288cb156c5e72 | 18,244 | py | Python | pandaharvester/harvesterzipper/base_zipper.py | PanDAWMS/panda-havester | 90aefac49bb85dc815791105e65c602979079aaa | [
"Apache-2.0"
] | 11 | 2017-06-01T10:16:58.000Z | 2019-11-22T08:41:36.000Z | pandaharvester/harvesterzipper/base_zipper.py | PanDAWMS/panda-havester | 90aefac49bb85dc815791105e65c602979079aaa | [
"Apache-2.0"
] | 34 | 2016-10-25T19:15:24.000Z | 2021-03-05T12:59:04.000Z | pandaharvester/harvesterzipper/base_zipper.py | PanDAWMS/panda-havester | 90aefac49bb85dc815791105e65c602979079aaa | [
"Apache-2.0"
] | 17 | 2016-10-24T13:29:45.000Z | 2021-03-23T17:35:27.000Z | import os
import uuid
import time
import multiprocessing
import tempfile
import gc
from concurrent.futures import ThreadPoolExecutor as Pool
try:
import subprocess32 as subprocess
except ImportError:
import subprocess
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestercor... | 45.839196 | 119 | 0.478294 | import os
import uuid
import time
import multiprocessing
import tempfile
import gc
from concurrent.futures import ThreadPoolExecutor as Pool
try:
import subprocess32 as subprocess
except ImportError:
import subprocess
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestercor... | true | true |
1c4288efd617819e6d0091556a0abbfdca80a2e0 | 16,472 | py | Python | python/ccxt/lbank.py | Kubulus1997/Trading | caa80b8fed76e0bdc0b6b8d99f9f27f89fa545e2 | [
"MIT"
] | null | null | null | python/ccxt/lbank.py | Kubulus1997/Trading | caa80b8fed76e0bdc0b6b8d99f9f27f89fa545e2 | [
"MIT"
] | null | null | null | python/ccxt/lbank.py | Kubulus1997/Trading | caa80b8fed76e0bdc0b6b8d99f9f27f89fa545e2 | [
"MIT"
] | 1 | 2021-07-20T10:37:02.000Z | 2021-07-20T10:37:02.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... | 37.52164 | 126 | 0.477598 |
ge import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors import DDoSProtection
class lbank (Exchange):
def describe(self):
return self.deep_extend(super(lbank, self).descri... | true | true |
1c42892c331158d5d88c0c7c4c0962617cdcf447 | 485 | py | Python | examples/scan/plot_gs_energy.py | f-koehler/mlxtk | 373aed06ab23ab9b70cd99e160228c50b87e939a | [
"MIT"
] | 2 | 2018-12-21T19:41:10.000Z | 2019-11-25T15:26:27.000Z | examples/scan/plot_gs_energy.py | f-koehler/mlxtk | 373aed06ab23ab9b70cd99e160228c50b87e939a | [
"MIT"
] | 73 | 2017-12-22T13:30:16.000Z | 2022-02-22T04:21:14.000Z | examples/scan/plot_gs_energy.py | f-koehler/mlxtk | 373aed06ab23ab9b70cd99e160228c50b87e939a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os.path
import matplotlib.pyplot as plt
import numpy
import mlxtk
import mlxtk.inout.output
parameters = mlxtk.load_scan("harmonic_trap_scan")
def load_gs_energy(idx, path, parameter):
data = mlxtk.inout.output.read_output(os.path.join(path, "gs_relax/output"))
return parameter... | 21.086957 | 80 | 0.719588 |
import os.path
import matplotlib.pyplot as plt
import numpy
import mlxtk
import mlxtk.inout.output
parameters = mlxtk.load_scan("harmonic_trap_scan")
def load_gs_energy(idx, path, parameter):
data = mlxtk.inout.output.read_output(os.path.join(path, "gs_relax/output"))
return parameter.m, data[2][-1]
dat... | true | true |
1c4289735bfd091d0116b5f9487f65562d2b9827 | 556 | py | Python | Server/ChatBot/venv/Lib/site-packages/numpy/_distributor_init.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 1 | 2020-02-23T21:19:50.000Z | 2020-02-23T21:19:50.000Z | Server/ChatBot/venv/Lib/site-packages/numpy/_distributor_init.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | null | null | null | Server/ChatBot/venv/Lib/site-packages/numpy/_distributor_init.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 6 | 2020-04-13T15:33:30.000Z | 2020-06-21T19:26:55.000Z | """ Initialization specific to SSE2 builds of BLAS / LAPACK libs
"""
# Add check for SSE2 on Windows
try:
from ctypes import windll, wintypes
except (ImportError, ValueError):
pass
else:
has_feature = windll.kernel32.IsProcessorFeaturePresent
has_feature.argtypes = [wintypes.DWORD]
if not has_featu... | 32.705882 | 72 | 0.679856 |
try:
from ctypes import windll, wintypes
except (ImportError, ValueError):
pass
else:
has_feature = windll.kernel32.IsProcessorFeaturePresent
has_feature.argtypes = [wintypes.DWORD]
if not has_feature(10):
msg = ("This version of numpy needs a CPU capable of SSE2, "
"but Wi... | true | true |
1c4289fdf974e38881ea950e3cfa61040daa4b6a | 566 | py | Python | ex17.py | bardia52/Learn.Python.The.Hard.Way | 6a7dfece2017acb5b47a9aeb8b33b4dad725fbd5 | [
"MIT"
] | null | null | null | ex17.py | bardia52/Learn.Python.The.Hard.Way | 6a7dfece2017acb5b47a9aeb8b33b4dad725fbd5 | [
"MIT"
] | null | null | null | ex17.py | bardia52/Learn.Python.The.Hard.Way | 6a7dfece2017acb5b47a9aeb8b33b4dad725fbd5 | [
"MIT"
] | null | null | null | from sys import argv
from os.path import exists
script, from_file, to_file = argv
print "Copying from %s to %s" % (from_file, to_file)
# we could do these two on one line too, how?
#in_file = open(from_file)
#indata = in_file.read()
indata = open(from_file).read()
print "The input file is %d bytes long" % len(indat... | 21.769231 | 56 | 0.715548 | from sys import argv
from os.path import exists
script, from_file, to_file = argv
print "Copying from %s to %s" % (from_file, to_file)
indata = open(from_file).read()
print "The input file is %d bytes long" % len(indata)
print "Does the output file exist? %r" % exists(to_file)
print "Ready, hit RETURN to contin... | false | true |
1c428a469d716395d9ececbaae305a7cce0e5772 | 126,893 | py | Python | keystone/tests/test_backend_ldap.py | BMDan/keystone | 39de8b0a0a34c1645b607449fc1247d5cc11d89d | [
"Apache-2.0"
] | null | null | null | keystone/tests/test_backend_ldap.py | BMDan/keystone | 39de8b0a0a34c1645b607449fc1247d5cc11d89d | [
"Apache-2.0"
] | null | null | null | keystone/tests/test_backend_ldap.py | BMDan/keystone | 39de8b0a0a34c1645b607449fc1247d5cc11d89d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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
#
... | 43.605842 | 79 | 0.625535 |
import copy
import uuid
import ldap
import mock
from testtools import matchers
from keystone import assignment
from keystone.common import cache
from keystone.common import ldap as common_ldap
from keystone.common.ldap import core as common_ldap_core
from keystone.common import sql
from keystone impor... | true | true |
1c428a87c47d58c69d87bdaa6594d7a2b98be1e1 | 1,557 | py | Python | Training/testModel.py | TWCurry/emotion-recognition-training-platform | 748fcdf2558fbfe9fb1523ef4024e7373543f0e3 | [
"MIT"
] | null | null | null | Training/testModel.py | TWCurry/emotion-recognition-training-platform | 748fcdf2558fbfe9fb1523ef4024e7373543f0e3 | [
"MIT"
] | null | null | null | Training/testModel.py | TWCurry/emotion-recognition-training-platform | 748fcdf2558fbfe9fb1523ef4024e7373543f0e3 | [
"MIT"
] | null | null | null | import sys, os
import tensorflow as tf
import numpy as np
from tensorflow import keras
import matplotlib.pyplot as plt
imgHeight = 762
imgWidth = 562
emotionCodes = ["AF", "AN", "DI", "HA", "NE", "SA", "SU"]
emotionNames = ["Afraid", "Angry", "Disgusted", "Happy", "Neutral", "Sad", "Surprised"]
def main():
try:
... | 37.97561 | 127 | 0.649326 | import sys, os
import tensorflow as tf
import numpy as np
from tensorflow import keras
import matplotlib.pyplot as plt
imgHeight = 762
imgWidth = 562
emotionCodes = ["AF", "AN", "DI", "HA", "NE", "SA", "SU"]
emotionNames = ["Afraid", "Angry", "Disgusted", "Happy", "Neutral", "Sad", "Surprised"]
def main():
try:
... | true | true |
1c428aad04470cc050f9150015da22fd25145f7a | 7,723 | py | Python | tests/test_cli_analyze.py | tk-ML/SALib | b090a1699e6df9b789723bf0097521e5dc316e4c | [
"MIT"
] | 1 | 2021-06-22T08:27:17.000Z | 2021-06-22T08:27:17.000Z | tests/test_cli_analyze.py | JimmyKude/SALib | 2545a439ca474a673fddadf0399f7c4e21000d99 | [
"MIT"
] | null | null | null | tests/test_cli_analyze.py | JimmyKude/SALib | 2545a439ca474a673fddadf0399f7c4e21000d99 | [
"MIT"
] | null | null | null | import sys
import subprocess
from SALib.test_functions import Ishigami
import numpy as np
import re
salib_cli = "./src/SALib/scripts/salib.py"
ishigami_fp = "./src/SALib/test_functions/params/Ishigami.txt"
if sys.version_info[0] == 2:
subprocess.run = subprocess.call
def test_delta():
cmd = "python {cli} sa... | 38.422886 | 245 | 0.65661 | import sys
import subprocess
from SALib.test_functions import Ishigami
import numpy as np
import re
salib_cli = "./src/SALib/scripts/salib.py"
ishigami_fp = "./src/SALib/test_functions/params/Ishigami.txt"
if sys.version_info[0] == 2:
subprocess.run = subprocess.call
def test_delta():
cmd = "python {cli} sa... | true | true |
1c428bebeb6bf553a525fd33bd5c9ffd2aac7acd | 944 | py | Python | michelanglo_app/security.py | matteoferla/PyMOL-to-NGL-transpiler | 3e1ce6cecde4b913188afa4472148bc5ab7f34a8 | [
"MIT"
] | 11 | 2020-03-23T03:41:36.000Z | 2022-03-11T18:53:26.000Z | michelanglo_app/security.py | thesgc/MichelaNGLo | ad8a2e5207638e82bb4163662af351b4864f39c1 | [
"MIT"
] | 1 | 2020-05-13T20:07:51.000Z | 2020-06-25T04:44:57.000Z | michelanglo_app/security.py | thesgc/MichelaNGLo | ad8a2e5207638e82bb4163662af351b4864f39c1 | [
"MIT"
] | 1 | 2019-11-11T19:12:26.000Z | 2019-11-11T19:12:26.000Z | from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from .models import User
class MyAuthenticationPolicy(AuthTktAuthenticationPolicy):
def authenticated_userid(self, request):
user = request.user
if user is not None:
... | 31.466667 | 67 | 0.723517 | from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from .models import User
class MyAuthenticationPolicy(AuthTktAuthenticationPolicy):
def authenticated_userid(self, request):
user = request.user
if user is not None:
... | true | true |
1c428c8f3dd3802d4ef990317e40f6a83e5179fb | 1,490 | py | Python | components/alibi-explain-server/setup.py | bmfisher/seldon-core | 69fbae930dad4999c2225773468fe462442ec8be | [
"Apache-2.0"
] | null | null | null | components/alibi-explain-server/setup.py | bmfisher/seldon-core | 69fbae930dad4999c2225773468fe462442ec8be | [
"Apache-2.0"
] | 60 | 2021-06-18T03:25:51.000Z | 2022-03-28T04:07:46.000Z | components/alibi-explain-server/setup.py | rajgupt/seldon-core | e48d01bc02a424d94b7a7303798b5cd7e7e82e13 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 kubeflow.org.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 32.391304 | 94 | 0.655705 |
from setuptools import setup, find_packages
tests_require = ["pytest", "pytest-tornasync", "mypy"]
setup(
name="alibiexplainer",
version="0.3.0",
author_email="cc@seldon.io",
license="../../LICENSE.txt",
url="https://github.com/SeldonIO/seldon-core/tree/master/components/alibi-explai... | true | true |
1c428cd385440ea3c0ccbe81db1d5ce97b0ee4ef | 1,047 | py | Python | setup.py | cablelabs/snaps-orchestration | 0c55208e73e8ecd6c9e365215f931b5612a82ea9 | [
"Apache-2.0"
] | 1 | 2021-05-17T13:52:20.000Z | 2021-05-17T13:52:20.000Z | setup.py | cablelabs/snaps-common | d65764d19414510e93906da706afda2b6d2aa7fb | [
"Apache-2.0"
] | 10 | 2019-02-28T21:35:34.000Z | 2021-09-23T23:25:05.000Z | setup.py | cablelabs/snaps-orchestration | 0c55208e73e8ecd6c9e365215f931b5612a82ea9 | [
"Apache-2.0"
] | 1 | 2019-02-13T10:10:41.000Z | 2019-02-13T10:10:41.000Z | # Copyright (c) 2018 Cable Television Laboratories, Inc. ("CableLabs")
# and others. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://w... | 36.103448 | 74 | 0.729704 |
import setuptools
import multiprocessing
except ImportError:
pass
setuptools.setup(
setup_requires=['pbr>=2.0.0'],
test_suite='tests',
pbr=True)
| true | true |
1c428d1476cfb6464eafd4c10af8c2321eaeb5b8 | 4,846 | py | Python | test_lanenet.py | sschoedel/lanenet-lane-detection | 210116a7d4d1324fcfb2b8b50404e4c3bf99811f | [
"Apache-2.0"
] | null | null | null | test_lanenet.py | sschoedel/lanenet-lane-detection | 210116a7d4d1324fcfb2b8b50404e4c3bf99811f | [
"Apache-2.0"
] | null | null | null | test_lanenet.py | sschoedel/lanenet-lane-detection | 210116a7d4d1324fcfb2b8b50404e4c3bf99811f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 18-5-23 上午11:33
# @Author : MaybeShewill-CV
# @Site : https://github.com/MaybeShewill-CV/lanenet-lane-detection
# @File : test_lanenet.py
# @IDE: PyCharm Community Edition
"""
test LaneNet model on single image
"""
import argparse
import os.path as ops
... | 29.730061 | 98 | 0.666529 |
import argparse
import os.path as ops
import time
import cv2
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from lanenet_model import lanenet
from lanenet_model import lanenet_postprocess
from local_utils.config_utils import parse_config_utils
from local_utils.log_util import init_l... | true | true |
1c428d60ac80347b2d212dd41c3d7dd711aec90e | 234 | py | Python | inst/admin.py | collinsbett29/insta | 2b78fbef9b4739cfd5fe6e6a86ccf4f850f33581 | [
"MIT"
] | null | null | null | inst/admin.py | collinsbett29/insta | 2b78fbef9b4739cfd5fe6e6a86ccf4f850f33581 | [
"MIT"
] | 3 | 2020-06-06T00:04:18.000Z | 2021-09-08T01:25:53.000Z | inst/admin.py | collinsbett29/Instagram | 2b78fbef9b4739cfd5fe6e6a86ccf4f850f33581 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.contrib import admin
from .models import Profile, Image, Comments
# Register your models here.
admin.site.register(Profile)
admin.site.register(Image)
admin.site.register(Comments) | 26 | 44 | 0.824786 | from __future__ import unicode_literals
from django.contrib import admin
from .models import Profile, Image, Comments
admin.site.register(Profile)
admin.site.register(Image)
admin.site.register(Comments) | true | true |
1c428dfa6d43a5952b138faaddf251c3aef2beb6 | 2,906 | py | Python | pyne/dbgen/kaeri.py | ypark234/pyne | b7c4932c0399e6a0881aea943b392fb97cd0b6bd | [
"MIT"
] | 1 | 2019-10-10T14:14:11.000Z | 2019-10-10T14:14:11.000Z | pyne/dbgen/kaeri.py | ypark234/pyne | b7c4932c0399e6a0881aea943b392fb97cd0b6bd | [
"MIT"
] | 58 | 2019-01-07T16:13:26.000Z | 2019-05-09T15:56:26.000Z | pyne/dbgen/kaeri.py | ypark234/pyne | b7c4932c0399e6a0881aea943b392fb97cd0b6bd | [
"MIT"
] | null | null | null | from __future__ import print_function
import os
import re
import sys
from warnings import warn
from pyne.utils import QAWarning
try:
import urllib.request as urllib2
from urllib.error import URLError
except ImportError:
import urllib2
from urllib2 import URLError
from pyne import nucname
warn(__name_... | 31.247312 | 93 | 0.611838 | from __future__ import print_function
import os
import re
import sys
from warnings import warn
from pyne.utils import QAWarning
try:
import urllib.request as urllib2
from urllib.error import URLError
except ImportError:
import urllib2
from urllib2 import URLError
from pyne import nucname
warn(__name_... | true | true |
1c428e344a4510bb9bcff5766db0a66d09b5906c | 327,578 | py | Python | test/test_ITU.py | the-aerospace-corporation/ITU-Rpy | 4456da2db9f28453d5a08339c84fe5bf25b999d8 | [
"MIT"
] | null | null | null | test/test_ITU.py | the-aerospace-corporation/ITU-Rpy | 4456da2db9f28453d5a08339c84fe5bf25b999d8 | [
"MIT"
] | null | null | null | test/test_ITU.py | the-aerospace-corporation/ITU-Rpy | 4456da2db9f28453d5a08339c84fe5bf25b999d8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest as test
import itur
import itur.models as models
import sys
from astropy import units as u
def suite():
""" A test suite for the ITU-P Recommendations. Recommendations tested:
* ITU-P R-676-9
* ITU-P R-676-11
* ITU-P R-618-12
* ITU-P R-618-13
* ITU-P R... | 41.444585 | 79 | 0.567102 |
import unittest as test
import itur
import itur.models as models
import sys
from astropy import units as u
def suite():
suite = test.TestSuite()
models.itu453.change_version(13)
models.itu618.change_version(13)
models.itu676.change_version(11)
models.itu836.change_version(6)
models.it... | true | true |
1c428eae5cf4633221c128c42d673f87b5eb1d9e | 34,233 | py | Python | src/transformers/configuration_utils.py | JadeMaveric/transformers | fb2b89840bf2ab9f74702bf83af8ddf92b61efb3 | [
"Apache-2.0"
] | 1 | 2021-03-31T02:23:56.000Z | 2021-03-31T02:23:56.000Z | src/transformers/configuration_utils.py | JadeMaveric/transformers | fb2b89840bf2ab9f74702bf83af8ddf92b61efb3 | [
"Apache-2.0"
] | null | null | null | src/transformers/configuration_utils.py | JadeMaveric/transformers | fb2b89840bf2ab9f74702bf83af8ddf92b61efb3 | [
"Apache-2.0"
] | 1 | 2020-11-02T06:37:04.000Z | 2020-11-02T06:37:04.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 54.424483 | 153 | 0.650074 |
import copy
import json
import os
from typing import Any, Dict, Tuple, Union
from . import __version__
from .file_utils import CONFIG_NAME, cached_path, hf_bucket_url, is_offline_mode, is_remote_url
from .utils import logging
logger = logging.get_logger(__name__)
class PretrainedConfig(object):
... | true | true |
1c42908df0243e91686259f79b9018afec52a52a | 828 | py | Python | tests/regression/failing_link_to_playlist.py | EdwardBetts/pyspotify | 851c622e814dee59362d27d978251bd3891c59f7 | [
"Apache-2.0"
] | 2 | 2016-11-18T08:49:26.000Z | 2018-05-14T13:27:19.000Z | tests/regression/failing_link_to_playlist.py | spankders/pyspotify | b18ac0c72771e6c3418f0d57b775ae5c6e1ab44e | [
"Apache-2.0"
] | null | null | null | tests/regression/failing_link_to_playlist.py | spankders/pyspotify | b18ac0c72771e6c3418f0d57b775ae5c6e1ab44e | [
"Apache-2.0"
] | 1 | 2021-06-24T15:57:12.000Z | 2021-06-24T15:57:12.000Z | # TODO This example should work, but fails to get the URIs of the playlists.
from __future__ import print_function
import logging
import time
import spotify
logging.basicConfig(level=logging.INFO)
# Assuming a spotify_appkey.key in the current dir:
session = spotify.Session()
# Assuming a previous login with reme... | 22.378378 | 76 | 0.781401 |
from __future__ import print_function
import logging
import time
import spotify
logging.basicConfig(level=logging.INFO)
session = spotify.Session()
session.relogin()
while session.connection.state != spotify.ConnectionState.LOGGED_IN:
session.process_events()
user = session.get_user('spotify:user:p3.no')... | true | true |
1c4291004131394ab0fba2226f14363deb904bba | 618 | py | Python | Classes/Endereco_Classe.py | felipemamore/SalaGreen-Felipe | 73664b77fdd09400e9129364308dded0fc15234d | [
"Apache-2.0"
] | null | null | null | Classes/Endereco_Classe.py | felipemamore/SalaGreen-Felipe | 73664b77fdd09400e9129364308dded0fc15234d | [
"Apache-2.0"
] | null | null | null | Classes/Endereco_Classe.py | felipemamore/SalaGreen-Felipe | 73664b77fdd09400e9129364308dded0fc15234d | [
"Apache-2.0"
] | null | null | null | class Endereco:
def __init__(self) -> None:
self.__rua = ''
self.__bairro = ''
self.__cidade = ''
def getRua(self)-> str:
return self.__rua
def getBairro(self)-> str:
return self.__bairro
def getCidade(self)-> str:
return self.__cidade
def setRua(s... | 19.935484 | 40 | 0.533981 | class Endereco:
def __init__(self) -> None:
self.__rua = ''
self.__bairro = ''
self.__cidade = ''
def getRua(self)-> str:
return self.__rua
def getBairro(self)-> str:
return self.__bairro
def getCidade(self)-> str:
return self.__cidade
def setRua(s... | true | true |
1c429124c9b888185020e023d92debd615d5a131 | 840 | py | Python | wagtailformblocks/forms.py | LUKKIEN/wagtailformblocks | d38dc6d42157eedeca25ed461873c00872bbf54d | [
"BSD-3-Clause"
] | 16 | 2016-08-26T12:59:47.000Z | 2022-03-23T08:11:08.000Z | wagtailformblocks/forms.py | LUKKIEN/wagtailformblocks | d38dc6d42157eedeca25ed461873c00872bbf54d | [
"BSD-3-Clause"
] | 10 | 2016-09-01T06:58:41.000Z | 2020-05-08T13:47:00.000Z | wagtailformblocks/forms.py | LUKKIEN/wagtailformblocks | d38dc6d42157eedeca25ed461873c00872bbf54d | [
"BSD-3-Clause"
] | 10 | 2016-09-09T22:14:02.000Z | 2021-10-05T16:15:44.000Z | from captcha.fields import ReCaptchaField
from wagtail.contrib.forms.forms import FormBuilder as OrigFormBuilder
from wagtailformblocks.utils.conf import (get_formblocks_setting,
recaptcha_enabled)
class FormBuilder(OrigFormBuilder):
def __init__(self, fields, **kwargs)... | 31.111111 | 71 | 0.695238 | from captcha.fields import ReCaptchaField
from wagtail.contrib.forms.forms import FormBuilder as OrigFormBuilder
from wagtailformblocks.utils.conf import (get_formblocks_setting,
recaptcha_enabled)
class FormBuilder(OrigFormBuilder):
def __init__(self, fields, **kwargs)... | true | true |
1c4292daca769d18c98cc09276b509285319627b | 562 | py | Python | neoload/neoload_cli_lib/cli_exception.py | stephanemartin/neoload-cli | aa128aad9a446e94d5700e8a25b674397d633e1a | [
"BSD-2-Clause"
] | 9 | 2020-06-01T14:28:37.000Z | 2022-03-06T23:21:09.000Z | neoload/neoload_cli_lib/cli_exception.py | stephanemartin/neoload-cli | aa128aad9a446e94d5700e8a25b674397d633e1a | [
"BSD-2-Clause"
] | 97 | 2019-12-06T23:52:19.000Z | 2022-02-11T14:22:07.000Z | neoload/neoload_cli_lib/cli_exception.py | stephanemartin/neoload-cli | aa128aad9a446e94d5700e8a25b674397d633e1a | [
"BSD-2-Clause"
] | 23 | 2020-03-24T18:38:58.000Z | 2022-03-04T16:09:23.000Z | import traceback
import click
_CliException__debug = False
class CliException(click.ClickException):
__debug = False
@staticmethod
def set_debug(boolean: bool):
CliException.__debug = boolean
def __init__(self, message):
super().__init__(message)
def format_message(self):
... | 20.814815 | 67 | 0.66548 | import traceback
import click
_CliException__debug = False
class CliException(click.ClickException):
__debug = False
@staticmethod
def set_debug(boolean: bool):
CliException.__debug = boolean
def __init__(self, message):
super().__init__(message)
def format_message(self):
... | true | true |
1c429356562f114ce6582ad14d6176986c1d9301 | 2,714 | py | Python | tests/loris/transcoders/abstract_jp2_transcoder_tests.py | jpstroop/loris-redux | b5db56d5a250fdb24486afe01bad55b81761701a | [
"BSD-2-Clause"
] | 7 | 2016-08-09T17:39:05.000Z | 2016-09-26T19:37:30.000Z | tests/loris/transcoders/abstract_jp2_transcoder_tests.py | jpstroop/loris-redux | b5db56d5a250fdb24486afe01bad55b81761701a | [
"BSD-2-Clause"
] | 183 | 2016-06-02T22:07:05.000Z | 2022-03-11T23:23:01.000Z | tests/loris/transcoders/abstract_jp2_transcoder_tests.py | jpstroop/loris-redux | b5db56d5a250fdb24486afe01bad55b81761701a | [
"BSD-2-Clause"
] | 1 | 2016-08-09T17:39:11.000Z | 2016-08-09T17:39:11.000Z | from loris.transcoders.abstract_jp2_transcoder import AbstractJp2Transcoder
from unittest.mock import Mock
import os
import stat
class TestAbstractJp2Transcoder(object):
def test__named_pipe(self):
class ActualJp2Transcoder(AbstractJp2Transcoder):
def _build_command(self, image_request, fifo_p... | 34.35443 | 81 | 0.613117 | from loris.transcoders.abstract_jp2_transcoder import AbstractJp2Transcoder
from unittest.mock import Mock
import os
import stat
class TestAbstractJp2Transcoder(object):
def test__named_pipe(self):
class ActualJp2Transcoder(AbstractJp2Transcoder):
def _build_command(self, image_request, fifo_p... | true | true |
1c429436ef5996742d357dcc02e199509abf1571 | 6,777 | py | Python | fixit/common/utils.py | lpetre/Fixit | f2e5c080cde2febff194f3a29074d51a29667d10 | [
"Apache-2.0"
] | null | null | null | fixit/common/utils.py | lpetre/Fixit | f2e5c080cde2febff194f3a29074d51a29667d10 | [
"Apache-2.0"
] | 1 | 2022-03-16T19:17:23.000Z | 2022-03-16T19:17:23.000Z | fixit/common/utils.py | isabella232/Fixit-1 | f2e5c080cde2febff194f3a29074d51a29667d10 | [
"Apache-2.0"
] | null | null | null | # 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 importlib
import inspect
import json
import pkgutil
import re
import textwrap
from dataclasses import dataclass
from pathlib import Pat... | 34.227273 | 122 | 0.665486 |
import importlib
import inspect
import json
import pkgutil
import re
import textwrap
from dataclasses import dataclass
from pathlib import Path
from types import ModuleType
from typing import cast, Dict, List, Optional, Set, Type, Union
import libcst as cst
from libcst._add_slots import add_slots
from libcst.meta... | true | true |
1c4294ab8693747f0c625c1eb7d5e3d646153131 | 3,072 | py | Python | examples/basic_operations/pause_ad.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/pause_ad.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/pause_ad.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 42.666667 | 79 | 0.696615 |
import argparse
import sys
from google.api_core import protobuf_helpers
from google.ads.google_ads.client import GoogleAdsClient
from google.ads.google_ads.util import ResourceName
def main(client, customer_id, ad_group_id, ad_id):
ad_group_ad_service = client.get_service('AdGroupAdService', vers... | true | true |
1c42955367038b75ae9e6a93fc585d5e3fda38ec | 385 | py | Python | bahasa/stemmer/disambiguator/prefixes/rule_27.py | kangfend/bahasa | 11f64d4116146dd238c1f2a38146ccf87443e522 | [
"MIT"
] | 9 | 2016-10-04T10:09:37.000Z | 2021-11-15T03:48:11.000Z | bahasa/stemmer/disambiguator/prefixes/rule_27.py | kangfend/bahasa | 11f64d4116146dd238c1f2a38146ccf87443e522 | [
"MIT"
] | null | null | null | bahasa/stemmer/disambiguator/prefixes/rule_27.py | kangfend/bahasa | 11f64d4116146dd238c1f2a38146ccf87443e522 | [
"MIT"
] | 5 | 2016-09-19T06:37:48.000Z | 2021-02-20T06:51:50.000Z | import re
class Rule27(object):
"""Disambiguate Prefix Rule 27
Rule 27 : pen{c|d|j|z} -> pen-{c|d|j|z}
"""
def disambiguate(self, word):
"""Disambiguate Prefix Rule 27
Rule 27 : pen{c|d|j|z} -> pen-{c|d|j|z}
"""
matches = re.match(r'^pen([cdjz])(.*)$', word)
if... | 24.0625 | 54 | 0.527273 | import re
class Rule27(object):
def disambiguate(self, word):
matches = re.match(r'^pen([cdjz])(.*)$', word)
if matches:
return matches.group(1) + matches.group(2)
| true | true |
1c4295c5e9fde962daa9ec269cfdcd10d797ac33 | 11,795 | py | Python | train_sage_EL2N_increment.py | DAIZHENWEI/FastGCN_pytorch | 87efe350d5acbe517a0642e9862ac9676b55c053 | [
"MIT"
] | null | null | null | train_sage_EL2N_increment.py | DAIZHENWEI/FastGCN_pytorch | 87efe350d5acbe517a0642e9862ac9676b55c053 | [
"MIT"
] | null | null | null | train_sage_EL2N_increment.py | DAIZHENWEI/FastGCN_pytorch | 87efe350d5acbe517a0642e9862ac9676b55c053 | [
"MIT"
] | null | null | null | import argparse
import time
import os
import torch
import torch.nn.functional as F
import torch.optim as optim
import dgl
import torch.nn as nn
import dgl.nn.pytorch as dglnn
import numpy as np
import pdb
import tqdm
from scipy.sparse.linalg import norm as sparse_norm
from utils import get_batches, accuracy, Entropy_lo... | 48.539095 | 166 | 0.59432 | import argparse
import time
import os
import torch
import torch.nn.functional as F
import torch.optim as optim
import dgl
import torch.nn as nn
import dgl.nn.pytorch as dglnn
import numpy as np
import pdb
import tqdm
from scipy.sparse.linalg import norm as sparse_norm
from utils import get_batches, accuracy, Entropy_lo... | true | true |
1c4295c9cd865d1ecee704e8b8578562c6d021ee | 207 | py | Python | examples/pkg_json_fallback/pkg_json_fallback/__init__.py | ioam/autover | 66e9a3118697cef252b360b63697086a6ecf987a | [
"BSD-3-Clause"
] | 3 | 2018-05-25T12:08:12.000Z | 2019-06-09T02:34:46.000Z | examples/pkg_json_fallback/pkg_json_fallback/__init__.py | ioam/autover | 66e9a3118697cef252b360b63697086a6ecf987a | [
"BSD-3-Clause"
] | 36 | 2017-12-08T13:48:28.000Z | 2018-04-24T13:09:29.000Z | examples/pkg_json_fallback/pkg_json_fallback/__init__.py | ioam/autover | 66e9a3118697cef252b360b63697086a6ecf987a | [
"BSD-3-Clause"
] | 1 | 2020-04-13T12:01:31.000Z | 2020-04-13T12:01:31.000Z | # Only testing the JSON fallback. See pkg_bundle or pkg_depend for complete example.
import os, json
__version__ = json.load(open(os.path.join(os.path.dirname(__file__),'.version'), 'r'))['version_string']
| 41.4 | 104 | 0.758454 |
import os, json
__version__ = json.load(open(os.path.join(os.path.dirname(__file__),'.version'), 'r'))['version_string']
| true | true |
1c4295ea77ae8346ccc4dfd6a5e4aa5accf24713 | 7,863 | py | Python | src/step1_split_text.py | lychyzclc/High-throughput-relation-extraction-algorithm | 93530ddcb78df3f1b1b7fda34821fa307d095c74 | [
"MIT"
] | 1 | 2021-01-04T03:15:50.000Z | 2021-01-04T03:15:50.000Z | src/step1_split_text.py | lychyzclc/High-throughput-relation-extraction-algorithm | 93530ddcb78df3f1b1b7fda34821fa307d095c74 | [
"MIT"
] | null | null | null | src/step1_split_text.py | lychyzclc/High-throughput-relation-extraction-algorithm | 93530ddcb78df3f1b1b7fda34821fa307d095c74 | [
"MIT"
] | null | null | null | import argparse
import logging
import math
import re
from itertools import islice
from multiprocessing import Process
import spacy
from util.logger import get_logger
logger = logging.getLogger(__name__)
def strip_title(sub_str):
r = re.search('==+.*?==+', sub_str)
if r:
return sub_... | 39.315 | 102 | 0.375684 | import argparse
import logging
import math
import re
from itertools import islice
from multiprocessing import Process
import spacy
from util.logger import get_logger
logger = logging.getLogger(__name__)
def strip_title(sub_str):
r = re.search('==+.*?==+', sub_str)
if r:
return sub_... | true | true |
1c429768559837ca305652a8cdfd69ecf9b899b5 | 2,840 | py | Python | input_data/make_go_plus_holdouts.py | Knowledge-Graph-Hub/NEAT | 744b8abd6fc08037be349e2e637d891d80100771 | [
"BSD-3-Clause"
] | 6 | 2020-10-27T15:54:26.000Z | 2022-02-28T15:41:06.000Z | input_data/make_go_plus_holdouts.py | Knowledge-Graph-Hub/NEAT | 744b8abd6fc08037be349e2e637d891d80100771 | [
"BSD-3-Clause"
] | 52 | 2020-11-24T18:27:44.000Z | 2022-03-31T16:20:06.000Z | input_data/make_go_plus_holdouts.py | Knowledge-Graph-Hub/NEAT | 744b8abd6fc08037be349e2e637d891d80100771 | [
"BSD-3-Clause"
] | 1 | 2021-08-23T06:04:02.000Z | 2021-08-23T06:04:02.000Z | import os
from ensmallen_graph import EnsmallenGraph
from shutil import which
from neat.graph_embedding.graph_embedding import get_node_data, \
merge_and_write_complete_node_data
train_percentage = 0.8
seed = 42
go_plus_json_file = "go_plus.json"
go_plus_edges_file = "go_plus_edges.tsv"
go_plus_nodes_file = "go_... | 36.410256 | 107 | 0.73838 | import os
from ensmallen_graph import EnsmallenGraph
from shutil import which
from neat.graph_embedding.graph_embedding import get_node_data, \
merge_and_write_complete_node_data
train_percentage = 0.8
seed = 42
go_plus_json_file = "go_plus.json"
go_plus_edges_file = "go_plus_edges.tsv"
go_plus_nodes_file = "go_... | true | true |
1c4297c9f2abc51a2141ed38f24c6e7f25f9e979 | 1,614 | py | Python | hcl-api.py | briamorr/UCSHCL | c4aa8df78dc10b37499e73fca44a6f742b0fb802 | [
"MIT"
] | null | null | null | hcl-api.py | briamorr/UCSHCL | c4aa8df78dc10b37499e73fca44a6f742b0fb802 | [
"MIT"
] | null | null | null | hcl-api.py | briamorr/UCSHCL | c4aa8df78dc10b37499e73fca44a6f742b0fb802 | [
"MIT"
] | null | null | null | from time import sleep
import requests
results = []
resp = requests.post('https://ucshcltool.cloudapps.cisco.com/public/rest/osvendor/loadOsVendors',
headers={'Content-Type': 'application/x-www-form-urlencoded'})
for r in resp.json():
if "Microsoft" not in r['OSVENDOR'] and "VMware" n... | 52.064516 | 121 | 0.552664 | from time import sleep
import requests
results = []
resp = requests.post('https://ucshcltool.cloudapps.cisco.com/public/rest/osvendor/loadOsVendors',
headers={'Content-Type': 'application/x-www-form-urlencoded'})
for r in resp.json():
if "Microsoft" not in r['OSVENDOR'] and "VMware" n... | true | true |
1c429821437f43abdad44920e1f1cd3c0ddcecd2 | 11,811 | py | Python | samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py | kingdun3284/openapi-generator | 07d145828f33e9e2d9e5be6694bfb1d29db4fe07 | [
"Apache-2.0"
] | 3 | 2019-06-25T01:41:08.000Z | 2019-10-01T15:49:15.000Z | samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py | kingdun3284/openapi-generator | 07d145828f33e9e2d9e5be6694bfb1d29db4fe07 | [
"Apache-2.0"
] | 1 | 2022-02-27T20:01:11.000Z | 2022-02-27T20:01:11.000Z | samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py | kingdun3284/openapi-generator | 07d145828f33e9e2d9e5be6694bfb1d29db4fe07 | [
"Apache-2.0"
] | 2 | 2019-06-25T05:39:52.000Z | 2019-07-09T15:47:02.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 38.223301 | 174 | 0.542545 |
from __future__ import absolute_import
import re
import six
from petstore_api.api_client import ApiClient
from petstore_api.exceptions import (
ApiTypeError,
ApiValueError
)
from petstore_api.model_utils import (
check_allowed_values,
check_validations
)
class AnotherFakeApi(object):
de... | true | true |
1c42993e0f44f10aac7d85d890466a2f809cc09a | 19,246 | py | Python | salt/states/x509.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 1 | 2020-10-19T11:49:49.000Z | 2020-10-19T11:49:49.000Z | salt/states/x509.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/states/x509.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 1 | 2020-10-19T11:49:50.000Z | 2020-10-19T11:49:50.000Z | # -*- coding: utf-8 -*-
'''
Manage X509 Certificates
.. versionadded:: Beryllium
This module can enable managing a complete PKI infrastructure including creating private keys, CA's,
certificates and CRLs. It includes the ability to generate a private key on a server, and have the
corresponding public key sent to a re... | 30.842949 | 114 | 0.593474 |
from __future__ import absolute_import
import datetime
import os
import re
import copy
import salt.exceptions
import salt.utils
import salt.ext.six as six
def _revoked_to_list(revs):
list_ = []
for rev in revs:
for rev_name, props in six.iteritems(rev):
dict_ = {}
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.