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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0c6c9d53be4b7690f691af9859df23fb71fa58 | 38,971 | py | Python | network/network.py | VirtualEmbryo/lumen_network | 35b1dadccd087c9ef234f12c2735098b82890b34 | [
"MIT"
] | 1 | 2019-08-02T07:41:27.000Z | 2019-08-02T07:41:27.000Z | network/network.py | VirtualEmbryo/lumen_network | 35b1dadccd087c9ef234f12c2735098b82890b34 | [
"MIT"
] | null | null | null | network/network.py | VirtualEmbryo/lumen_network | 35b1dadccd087c9ef234f12c2735098b82890b34 | [
"MIT"
] | null | null | null | # Library for the dynamics of a lumen network
# The lumen are 2 dimensional and symmetric and connected with 1 dimensional tubes
#
# Created by A. Mielke, 2018
# Modified by M. Le Verge--Serandour on 8/04/2019
"""
network.py conf.init
Defines the class network and associated functions
Imports
... | 38.700099 | 215 | 0.497575 |
import numpy as np
import math
import os
class network:
def __init__(self, network_folder, out_path, t_step, tube_radius = 0.01, friction = 1, swelling = False, swelling_rate=0., save_area_dat=False):
self.network_folder = network_folder
self.gamma_lumen, self.gamma_contact, sel... | true | true |
1c0c6d4bd59d556352ecbde19f2e542e86cc625a | 6,332 | py | Python | synthesisdatabase/classifiers/synth_para_classifier.py | olivettigroup/synthesis-database-public | 3a5b96558249c3079b7acaf9e96bd0282c0341ce | [
"MIT"
] | 7 | 2017-02-28T01:01:02.000Z | 2021-05-24T04:48:01.000Z | synthesisdatabase/classifiers/synth_para_classifier.py | olivettigroup/synthesis-database-public | 3a5b96558249c3079b7acaf9e96bd0282c0341ce | [
"MIT"
] | 1 | 2019-03-07T06:38:28.000Z | 2019-04-04T18:14:38.000Z | synthesisdatabase/classifiers/synth_para_classifier.py | olivettigroup/synthesis-database-public | 3a5b96558249c3079b7acaf9e96bd0282c0341ce | [
"MIT"
] | 4 | 2017-05-01T18:57:39.000Z | 2020-06-04T06:01:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sklearn.linear_model import (LogisticRegression)
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import (train_test_split)
from sklearn.metrics import (precision_score, recall_score)
from pymongo import MongoClient
from json im... | 32.639175 | 186 | 0.650032 |
from sklearn.linear_model import (LogisticRegression)
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import (train_test_split)
from sklearn.metrics import (precision_score, recall_score)
from pymongo import MongoClient
from json import (loads)
from autologging import (logged, ... | false | true |
1c0c6d5cb85e0fa3112ab9c493ccd88334ea1a7c | 320 | py | Python | set-1/fixed_xor.py | tinchoabbate/cryptopals | 7ec525f6717a70afa8dedf3fcffab3d508198196 | [
"MIT"
] | null | null | null | set-1/fixed_xor.py | tinchoabbate/cryptopals | 7ec525f6717a70afa8dedf3fcffab3d508198196 | [
"MIT"
] | null | null | null | set-1/fixed_xor.py | tinchoabbate/cryptopals | 7ec525f6717a70afa8dedf3fcffab3d508198196 | [
"MIT"
] | null | null | null | import sys
def fixed_xor(message, mask):
# Message and mask should have same length
output = ''
for (c1, c2) in zip(message, mask):
output += chr(ord(c1) ^ ord(c2))
return output
if __name__ == '__main__':
print fixed_xor(sys.argv[1].decode('hex'), sys.argv[2].decode('hex')).encode('hex')
| 26.666667 | 87 | 0.628125 | import sys
def fixed_xor(message, mask):
output = ''
for (c1, c2) in zip(message, mask):
output += chr(ord(c1) ^ ord(c2))
return output
if __name__ == '__main__':
print fixed_xor(sys.argv[1].decode('hex'), sys.argv[2].decode('hex')).encode('hex')
| false | true |
1c0c6df965817bf63f5816697ece3c0182631104 | 32,235 | py | Python | droidbot/input_policy2.py | clixyz/droidbot | e222af95b1e93f97625c862bbdeed04c0f78b827 | [
"MIT"
] | null | null | null | droidbot/input_policy2.py | clixyz/droidbot | e222af95b1e93f97625c862bbdeed04c0f78b827 | [
"MIT"
] | null | null | null | droidbot/input_policy2.py | clixyz/droidbot | e222af95b1e93f97625c862bbdeed04c0f78b827 | [
"MIT"
] | null | null | null | import logging
import collections
import copy
import logging
import random
import time
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import pad_sequence
from .input_event import KeyEvent, IntentEvent, TouchEvent, UIEvent, KillAppEvent
from .i... | 43.210456 | 121 | 0.620164 | import logging
import collections
import copy
import logging
import random
import time
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import pad_sequence
from .input_event import KeyEvent, IntentEvent, TouchEvent, UIEvent, KillAppEvent
from .i... | true | true |
1c0c6e0c407dd71b02c4c7d48c086243511efbe0 | 5,599 | py | Python | src/anomaly/parallelReconstruction.py | ed-ortizm/anomaly | 87d0668133f0536532b9cd61c2a90fa998ec1ad3 | [
"MIT"
] | null | null | null | src/anomaly/parallelReconstruction.py | ed-ortizm/anomaly | 87d0668133f0536532b9cd61c2a90fa998ec1ad3 | [
"MIT"
] | 2 | 2021-10-01T22:12:49.000Z | 2022-02-04T19:41:47.000Z | src/anomaly/parallelReconstruction.py | ed-ortizm/anomaly | 87d0668133f0536532b9cd61c2a90fa998ec1ad3 | [
"MIT"
] | null | null | null | """process base parallelism to compute reconstruction anomaly scores"""
import itertools
import multiprocessing as mp
from multiprocessing.sharedctypes import RawArray
import numpy as np
import tensorflow as tf
from anomaly.reconstruction import ReconstructionAnomalyScore
from sdss.utils.managefiles import FileDirec... | 27.179612 | 79 | 0.58957 | import itertools
import multiprocessing as mp
from multiprocessing.sharedctypes import RawArray
import numpy as np
import tensorflow as tf
from anomaly.reconstruction import ReconstructionAnomalyScore
from sdss.utils.managefiles import FileDirectory
from autoencoders.ae import AutoEncoder
def to_numpy_array(array: ... | true | true |
1c0c6ea258dd558be9b4740099fa6dc85de15992 | 68,212 | py | Python | birch.py | roglew/birch | 1fd48abf0c720b6631909826f298be37bfbd0223 | [
"MIT"
] | null | null | null | birch.py | roglew/birch | 1fd48abf0c720b6631909826f298be37bfbd0223 | [
"MIT"
] | null | null | null | birch.py | roglew/birch | 1fd48abf0c720b6631909826f298be37bfbd0223 | [
"MIT"
] | null | null | null | import burp
import threading
import random
import urlparse
import weakref
import shlex
import json
import re
from operator import attrgetter
from java.lang import Integer, String
from java.util import ArrayList
from java.awt import Color
from java.awt import BorderLayout
from java.awt import FlowLayout
from java.awt ... | 35.106536 | 281 | 0.614731 | import burp
import threading
import random
import urlparse
import weakref
import shlex
import json
import re
from operator import attrgetter
from java.lang import Integer, String
from java.util import ArrayList
from java.awt import Color
from java.awt import BorderLayout
from java.awt import FlowLayout
from java.awt ... | true | true |
1c0c6fdb06ac0aea7b085ade72e6f886c66e9e7f | 4,432 | py | Python | atomicpuppy/__init__.py | daniel-butler/atomicpuppy | dfb98ed44bb727a793754d93bfc49b3276a6918d | [
"MIT"
] | null | null | null | atomicpuppy/__init__.py | daniel-butler/atomicpuppy | dfb98ed44bb727a793754d93bfc49b3276a6918d | [
"MIT"
] | null | null | null | atomicpuppy/__init__.py | daniel-butler/atomicpuppy | dfb98ed44bb727a793754d93bfc49b3276a6918d | [
"MIT"
] | null | null | null | from .atomicpuppy import (
Event,
EventCounter,
EventPublisher,
EventRaiser,
EventStoreJsonEncoder,
RedisCounter,
StreamConfigReader,
StreamFetcher,
StreamReader,
SubscriptionInfoStore,
EventFinder as EventFinder_,
)
from .errors import (
FatalError,
HttpClientError,
... | 30.993007 | 89 | 0.582356 | from .atomicpuppy import (
Event,
EventCounter,
EventPublisher,
EventRaiser,
EventStoreJsonEncoder,
RedisCounter,
StreamConfigReader,
StreamFetcher,
StreamReader,
SubscriptionInfoStore,
EventFinder as EventFinder_,
)
from .errors import (
FatalError,
HttpClientError,
... | true | true |
1c0c72460f921c6d7ecc3e4743505c2ee72a45b9 | 3,086 | py | Python | qiskit/aqua/algorithms/classical/exactlpsolver/exactlpsolver.py | dominik-steenken/qiskit-aqua | bba4c02040ccf45b066f67398407e3e6382458b4 | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/algorithms/classical/exactlpsolver/exactlpsolver.py | dominik-steenken/qiskit-aqua | bba4c02040ccf45b066f67398407e3e6382458b4 | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/algorithms/classical/exactlpsolver/exactlpsolver.py | dominik-steenken/qiskit-aqua | bba4c02040ccf45b066f67398407e3e6382458b4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 IBM.
#
# 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 agre... | 31.489796 | 81 | 0.604342 |
import logging
import numpy as np
from qiskit.aqua.algorithms import QuantumAlgorithm
from qiskit.aqua import AquaError
logger = logging.getLogger(__name__)
class ExactLPsolver(QuantumAlgorithm):
CONFIGURATION = {
'name': 'ExactLPsolver',
'description': 'ExactLPsolver Algorithm',
'cl... | true | true |
1c0c72fc0073e8d1313a5764e83fd042b111e4c3 | 350 | py | Python | Binary Search/descending order sorted array.py | ikaushikpal/DS-450-python | 9466f77fb9db9e6a5bb3f20aa89ba6332f49e848 | [
"MIT"
] | 3 | 2021-06-28T12:04:19.000Z | 2021-09-07T07:23:41.000Z | Binary Search/descending order sorted array.py | ikaushikpal/DS-450-python | 9466f77fb9db9e6a5bb3f20aa89ba6332f49e848 | [
"MIT"
] | null | null | null | Binary Search/descending order sorted array.py | ikaushikpal/DS-450-python | 9466f77fb9db9e6a5bb3f20aa89ba6332f49e848 | [
"MIT"
] | 1 | 2021-06-28T15:42:55.000Z | 2021-06-28T15:42:55.000Z | def reversedBinarySearch(arr, n, key):
low, high = 0, n-1
while low <= high:
mid = (low+high)//2
if arr[mid] == key:
return mid
elif arr[mid] > key:
low = mid + 1
else:
hig... | 21.875 | 38 | 0.348571 | def reversedBinarySearch(arr, n, key):
low, high = 0, n-1
while low <= high:
mid = (low+high)//2
if arr[mid] == key:
return mid
elif arr[mid] > key:
low = mid + 1
else:
hig... | true | true |
1c0c73b556e2770762c3359e4a34f74474f91ae5 | 863 | py | Python | myModel/_3LeNet5.py | KingJoySaiy/genderClassification | 1e518c6c600a9759d196b094998e37337e2de624 | [
"MIT"
] | null | null | null | myModel/_3LeNet5.py | KingJoySaiy/genderClassification | 1e518c6c600a9759d196b094998e37337e2de624 | [
"MIT"
] | null | null | null | myModel/_3LeNet5.py | KingJoySaiy/genderClassification | 1e518c6c600a9759d196b094998e37337e2de624 | [
"MIT"
] | null | null | null | import torch.nn as nn
from torch.nn import functional as F
# 3rd Edition: LeNet-5 (up to 86.405%)
class LeNet(nn.Module):
def __init__(self):
super(LeNet, self).__init__()
self.conv1 = nn.Conv2d(1, 6, 5)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16 * 47 * 47, 120)
... | 26.151515 | 55 | 0.546929 | import torch.nn as nn
from torch.nn import functional as F
class LeNet(nn.Module):
def __init__(self):
super(LeNet, self).__init__()
self.conv1 = nn.Conv2d(1, 6, 5)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16 * 47 * 47, 120)
self.fc2 = nn.Linear(120, 84)
... | true | true |
1c0c744b65c95f316568cdc490c50d675cc013df | 5,118 | py | Python | sdk/python/pulumi_azure_native/providerhub/v20201120/notification_registration.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/providerhub/v20201120/notification_registration.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/providerhub/v20201120/notification_registration.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 44.504348 | 445 | 0.674091 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['NotificationRegistration']
class NotificationRegistration(pulumi.CustomResource):
def ... | true | true |
1c0c7480b5609a41916e975bb7ebb1c6f7baf762 | 136 | py | Python | faebryk/exporters/netlist/__init__.py | NoR8quoh1r/faebryk | 9d0b2c20bc933d18f2f7124e69032fe308ab41bc | [
"MIT"
] | null | null | null | faebryk/exporters/netlist/__init__.py | NoR8quoh1r/faebryk | 9d0b2c20bc933d18f2f7124e69032fe308ab41bc | [
"MIT"
] | null | null | null | faebryk/exporters/netlist/__init__.py | NoR8quoh1r/faebryk | 9d0b2c20bc933d18f2f7124e69032fe308ab41bc | [
"MIT"
] | null | null | null | # This file is part of the faebryk project
# SPDX-License-Identifier: MIT
import faebryk.exporters.netlist.kicad
from .netlist import * | 27.2 | 42 | 0.794118 |
import faebryk.exporters.netlist.kicad
from .netlist import * | true | true |
1c0c74a3a9b7a43b035334ad8f4723cc797faf94 | 1,251 | py | Python | setup.py | Thru-Echoes/hw10_calcCalc | da0fe458aaa148c0813ef1fce0aa92235a985776 | [
"BSD-3-Clause"
] | null | null | null | setup.py | Thru-Echoes/hw10_calcCalc | da0fe458aaa148c0813ef1fce0aa92235a985776 | [
"BSD-3-Clause"
] | null | null | null | setup.py | Thru-Echoes/hw10_calcCalc | da0fe458aaa148c0813ef1fce0aa92235a985776 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import with_statement
import sys
try:
from setuptools import setup, Extension, Command
except ImportError:
from distutils.core import setup, Extension, Command
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError... | 30.512195 | 71 | 0.705835 | from __future__ import with_statement
import sys
try:
from setuptools import setup, Extension, Command
except ImportError:
from distutils.core import setup, Extension, Command
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError, \
DistutilsPlatf... | true | true |
1c0c7590f07dfca2faada2221ee65bab29d7285a | 2,274 | py | Python | testproject/tests/test_commands.py | merixstudio/django-imhotep | 4c4e16c7f5126dcf2c14392200b37765e1178de3 | [
"MIT"
] | 2 | 2018-10-05T06:41:29.000Z | 2018-10-05T06:41:40.000Z | testproject/tests/test_commands.py | merixstudio/django-imhotep | 4c4e16c7f5126dcf2c14392200b37765e1178de3 | [
"MIT"
] | null | null | null | testproject/tests/test_commands.py | merixstudio/django-imhotep | 4c4e16c7f5126dcf2c14392200b37765e1178de3 | [
"MIT"
] | null | null | null | import pytest
from trench.command.deactivate_mfa_method import deactivate_mfa_method_command
from trench.command.remove_backup_code import (
RemoveBackupCodeCommand,
remove_backup_code_command,
)
from trench.exceptions import MFAMethodDoesNotExistError, MFANotEnabledError
from trench.settings import DEFAULTS, ... | 32.956522 | 87 | 0.762973 | import pytest
from trench.command.deactivate_mfa_method import deactivate_mfa_method_command
from trench.command.remove_backup_code import (
RemoveBackupCodeCommand,
remove_backup_code_command,
)
from trench.exceptions import MFAMethodDoesNotExistError, MFANotEnabledError
from trench.settings import DEFAULTS, ... | true | true |
1c0c76264edbdedcb91490293e8ef7f495c1b160 | 3,398 | py | Python | _solutions.py | CaptainSora/Python-Project-Euler | 056400f434eec837ece5ef06653b310ebfcc3d4e | [
"MIT"
] | null | null | null | _solutions.py | CaptainSora/Python-Project-Euler | 056400f434eec837ece5ef06653b310ebfcc3d4e | [
"MIT"
] | null | null | null | _solutions.py | CaptainSora/Python-Project-Euler | 056400f434eec837ece5ef06653b310ebfcc3d4e | [
"MIT"
] | null | null | null | from importlib import import_module
import json
from time import perf_counter
from _user_input import bool_ans, num_ans
def timesoln(qnum, vol=0):
"""
Times and runs the question file, and returns [output, runtime].
"""
# Helper for savesoln()
start = perf_counter()
filename = f"PE{qnum:03}"
... | 29.807018 | 78 | 0.567393 | from importlib import import_module
import json
from time import perf_counter
from _user_input import bool_ans, num_ans
def timesoln(qnum, vol=0):
start = perf_counter()
filename = f"PE{qnum:03}"
try:
mod = import_module(filename)
except ModuleNotFoundError:
return [None, None]
... | true | true |
1c0c7645d7ee9ef29666275926159b9b73cf9882 | 331 | py | Python | src/bot/management/commands/run_daily_task.py | ItsCalebJones/SpaceLaunchNow_API | 09289068465c462557649172792ab0f41f833028 | [
"Apache-2.0"
] | 11 | 2017-06-26T05:01:31.000Z | 2019-09-13T18:48:27.000Z | src/bot/management/commands/run_daily_task.py | ItsCalebJones/SpaceLaunchNow_API | 09289068465c462557649172792ab0f41f833028 | [
"Apache-2.0"
] | 14 | 2019-01-30T23:13:34.000Z | 2019-10-08T10:43:36.000Z | src/bot/management/commands/run_daily_task.py | ItsCalebJones/SpaceLaunchNow_API | 09289068465c462557649172792ab0f41f833028 | [
"Apache-2.0"
] | 5 | 2018-04-24T16:52:59.000Z | 2018-08-22T14:06:01.000Z | import logging
from django.core.management import BaseCommand
from bot.tasks import run_daily
logger = logging.getLogger(__name__)
TAG = 'Digest Server'
class Command(BaseCommand):
help = 'Run Check Next Launch manually.'
def handle(self, *args, **options):
logger.info('Run Daily Check')
r... | 19.470588 | 46 | 0.70997 | import logging
from django.core.management import BaseCommand
from bot.tasks import run_daily
logger = logging.getLogger(__name__)
TAG = 'Digest Server'
class Command(BaseCommand):
help = 'Run Check Next Launch manually.'
def handle(self, *args, **options):
logger.info('Run Daily Check')
r... | true | true |
1c0c771c4ffe0d894212c604e77dfc6b58bc4d48 | 670 | py | Python | energyuse/apps/eusers/management/commands/reputation.py | evhart/energyuse | be76bac535bfea33d30867e232c2dcb35e1c7740 | [
"MIT"
] | null | null | null | energyuse/apps/eusers/management/commands/reputation.py | evhart/energyuse | be76bac535bfea33d30867e232c2dcb35e1c7740 | [
"MIT"
] | 14 | 2019-12-26T17:01:14.000Z | 2022-03-21T22:16:52.000Z | energyuse/apps/eusers/management/commands/reputation.py | evhart/energyuse | be76bac535bfea33d30867e232c2dcb35e1c7740 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from biostar.apps.posts.models import Vote, Post
from energyuse.apps.eusers.models import User
class Command(BaseCommand):
help = 'Recalculate user reputation'
def handle(self, *args, **options):
for user in User.objects.all():
... | 25.769231 | 66 | 0.558209 | from django.core.management.base import BaseCommand, CommandError
from biostar.apps.posts.models import Vote, Post
from energyuse.apps.eusers.models import User
class Command(BaseCommand):
help = 'Recalculate user reputation'
def handle(self, *args, **options):
for user in User.objects.all():
... | true | true |
1c0c77b69319065a7200f798cabf7240e5e79a5e | 990 | py | Python | app/app/urls.py | JustinDearden/product-api | e0ced978c460db11c08518d2912afac67cbfa2e5 | [
"MIT"
] | null | null | null | app/app/urls.py | JustinDearden/product-api | e0ced978c460db11c08518d2912afac67cbfa2e5 | [
"MIT"
] | null | null | null | app/app/urls.py | JustinDearden/product-api | e0ced978c460db11c08518d2912afac67cbfa2e5 | [
"MIT"
] | null | null | null | """app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 38.076923 | 77 | 0.717172 | from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path('admin/', admin.site.urls),
path('api/user/', include('user.urls')),
path('api/product/', include('product.urls')),
] + static(settings.MED... | true | true |
1c0c77cf1572fe2e49ef4261af2446840e9366d3 | 7,545 | py | Python | tinylocker/contracts/perm_sig.py | tinylock-org/tinylock_py | f1bdd21424db0911e97b479b1aef9bf7c3916777 | [
"MIT"
] | 4 | 2022-01-03T22:58:19.000Z | 2022-03-25T21:30:52.000Z | tinylocker/contracts/perm_sig.py | tinylock-org/tinylock_py | f1bdd21424db0911e97b479b1aef9bf7c3916777 | [
"MIT"
] | 2 | 2022-01-21T20:48:54.000Z | 2022-02-17T03:37:48.000Z | tinylocker/contracts/perm_sig.py | tinylock-org/tinylock_py | f1bdd21424db0911e97b479b1aef9bf7c3916777 | [
"MIT"
] | 4 | 2021-12-03T15:01:46.000Z | 2022-03-29T20:16:43.000Z | from pyteal import *
# Signature Params:
# Int
# Int
# Int
# String
def approval_program(
TMPL_ASSET_ID,
TMPL_CONTRACT_ID,
TMPL_FEETOKEN_ID,
TMPL_LOCKER_ADDRESS
):
gtx_lock_algo_fee_to_sig = And(
Gtxn[0].amount() >= Int(2000),
Gtxn[0].receiver() == Txn.sender(), # Signature should... | 36.100478 | 120 | 0.610073 | from pyteal import *
def approval_program(
TMPL_ASSET_ID,
TMPL_CONTRACT_ID,
TMPL_FEETOKEN_ID,
TMPL_LOCKER_ADDRESS
):
gtx_lock_algo_fee_to_sig = And(
Gtxn[0].amount() >= Int(2000),
Gtxn[0].receiver() == Txn.sender(), Gtxn[0].sender() == Addr(TMPL_LOCKER_ADDRESS) )
... | true | true |
1c0c78335dff87179a6125f5c00af7e9b55aaef5 | 1,774 | py | Python | azure-mgmt-resource/azure/mgmt/resource/policy/models/policy_assignment.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:16:34.000Z | 2018-11-09T06:16:34.000Z | azure-mgmt-resource/azure/mgmt/resource/policy/models/policy_assignment.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | null | null | null | azure-mgmt-resource/azure/mgmt/resource/policy/models/policy_assignment.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:17:41.000Z | 2018-11-09T06:17:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 36.958333 | 112 | 0.599211 |
from msrest.serialization import Model
class PolicyAssignment(Model):
_attribute_map = {
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'},
'scope': {'key': 'properties.scope', 'type': 'str'},... | true | true |
1c0c7846e39bf4e1fdc4a657b76f3df84e9c410a | 365 | py | Python | unitpy_custom/contents/wsgi.py | Y-Yoshimoto/ZbxHistryReport | 671cb348419b7e065f843ff46bb8a16d51a5de92 | [
"MIT"
] | null | null | null | unitpy_custom/contents/wsgi.py | Y-Yoshimoto/ZbxHistryReport | 671cb348419b7e065f843ff46bb8a16d51a5de92 | [
"MIT"
] | null | null | null | unitpy_custom/contents/wsgi.py | Y-Yoshimoto/ZbxHistryReport | 671cb348419b7e065f843ff46bb8a16d51a5de92 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import router_func as rfunc
import zabbix_APIuse as zget
import router_pass as rpass
def application(environ, start_response):
for path, func in rpass.routes:
if path == environ['PATH_INFO']:
return func(environ, start_response)
ret... | 24.333333 | 51 | 0.712329 | import sys
import router_func as rfunc
import zabbix_APIuse as zget
import router_pass as rpass
def application(environ, start_response):
for path, func in rpass.routes:
if path == environ['PATH_INFO']:
return func(environ, start_response)
return rfunc.not_found(environ, start_response)
| true | true |
1c0c78595968a478daa888e5295116fcb9ce824c | 1,391 | py | Python | setup.py | lixiaopi1985/dash-bootstrap-components | 9787b891bae553b5d10fb9c14de8797d3d7611c4 | [
"Apache-2.0"
] | 1 | 2019-03-19T06:35:03.000Z | 2019-03-19T06:35:03.000Z | setup.py | lixiaopi1985/dash-bootstrap-components | 9787b891bae553b5d10fb9c14de8797d3d7611c4 | [
"Apache-2.0"
] | null | null | null | setup.py | lixiaopi1985/dash-bootstrap-components | 9787b891bae553b5d10fb9c14de8797d3d7611c4 | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import find_packages, setup
HERE = os.path.dirname(os.path.abspath(__file__))
def _get_version():
""" Get version by parsing _version programmatically """
version_ns = {}
with open(
os.path.join(HERE, "dash_bootstrap_components", "_version.py")
) as f:
exec(... | 30.23913 | 70 | 0.664989 | import os
from setuptools import find_packages, setup
HERE = os.path.dirname(os.path.abspath(__file__))
def _get_version():
version_ns = {}
with open(
os.path.join(HERE, "dash_bootstrap_components", "_version.py")
) as f:
exec(f.read(), {}, version_ns)
version = version_ns["__version... | true | true |
1c0c79d106f927db737d080e3099a99893be871b | 3,592 | py | Python | simple-tensorflow-demo/3.neural network/tf_3rd_3_test.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-07-05T03:42:17.000Z | 2019-07-05T03:42:17.000Z | simple-tensorflow-demo/3.neural network/tf_3rd_3_test.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | simple-tensorflow-demo/3.neural network/tf_3rd_3_test.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-06-24T05:56:55.000Z | 2019-06-24T05:56:55.000Z | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
## 参数
# 学习率, 太小则每次optimizer变化很小, 学习速度慢; 太大则可能导致过度学习, 最终结果不准确
learning_rate = 0.01
# 隐藏层深度
training_epochs = 2000
# 打印的节点层
display_step = 50
## 构造训练数据
## numpy.asarray将list/turple转成矩阵
train_X = np.asarray([3.3, 4.4, 5.5, 6.71, 6.93, 4.168, 9.... | 29.68595 | 160 | 0.641147 | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
learning_rate = 0.01
training_epochs = 2000
display_step = 50
train_X = np.asarray([3.3, 4.4, 5.5, 6.71, 6.93, 4.168, 9.779, 6.182, 7.59, 2.167, 7.042, 10.791, 5.313, 7.997, 5.654, 9.27, 3.1])
train_Y = np.asarray([1.7, 2.76, 2.09, 3.19, 1.6... | true | true |
1c0c79f6e80f283afa234eae1d28797df370d33c | 3,563 | py | Python | spacy/tests/doc/test_array.py | Tiljander/spaCy | 5f2afa047927675795f9cd11f4c5d2a520dd68cf | [
"MIT"
] | 2 | 2020-04-17T05:23:36.000Z | 2021-09-17T06:27:31.000Z | spacy/tests/doc/test_array.py | Tiljander/spaCy | 5f2afa047927675795f9cd11f4c5d2a520dd68cf | [
"MIT"
] | 3 | 2021-06-08T21:06:32.000Z | 2022-01-13T02:22:38.000Z | spacy/tests/doc/test_array.py | Tiljander/spaCy | 5f2afa047927675795f9cd11f4c5d2a520dd68cf | [
"MIT"
] | 1 | 2020-08-13T12:21:58.000Z | 2020-08-13T12:21:58.000Z | # coding: utf-8
from __future__ import unicode_literals
import pytest
from spacy.tokens import Doc
from spacy.attrs import ORTH, SHAPE, POS, DEP
from ..util import get_doc
def test_doc_array_attr_of_token(en_vocab):
doc = Doc(en_vocab, words=["An", "example", "sentence"])
example = doc.vocab["example"]
... | 33.299065 | 76 | 0.654224 | from __future__ import unicode_literals
import pytest
from spacy.tokens import Doc
from spacy.attrs import ORTH, SHAPE, POS, DEP
from ..util import get_doc
def test_doc_array_attr_of_token(en_vocab):
doc = Doc(en_vocab, words=["An", "example", "sentence"])
example = doc.vocab["example"]
assert example.o... | true | true |
1c0c7b07e501362f3db4b9dedd4f08ff1247ad3a | 682 | py | Python | pytpp/properties/response_objects/secret_store.py | Venafi/pytpp | 42af655b2403b8c9447c86962abd4aaa0201f646 | [
"MIT"
] | 4 | 2022-02-04T23:58:55.000Z | 2022-02-15T18:53:08.000Z | pytpp/properties/response_objects/secret_store.py | Venafi/pytpp | 42af655b2403b8c9447c86962abd4aaa0201f646 | [
"MIT"
] | null | null | null | pytpp/properties/response_objects/secret_store.py | Venafi/pytpp | 42af655b2403b8c9447c86962abd4aaa0201f646 | [
"MIT"
] | null | null | null | from pytpp.properties.response_objects.dataclasses import secret_store
from pytpp.properties.resultcodes import ResultCodes
class SecretStore:
@staticmethod
def Result(code: int):
return secret_store.Result(
code=code,
secret_store_result=ResultCodes.SecretStore.get(code, 'Unkn... | 31 | 77 | 0.664223 | from pytpp.properties.response_objects.dataclasses import secret_store
from pytpp.properties.resultcodes import ResultCodes
class SecretStore:
@staticmethod
def Result(code: int):
return secret_store.Result(
code=code,
secret_store_result=ResultCodes.SecretStore.get(code, 'Unkn... | true | true |
1c0c7bac72eda1758e6c7ba63ac46864db5418c9 | 434 | py | Python | lps36/header/header.py | JGabrielGruber/lps36 | 6a8894c880ab2d1e3faf7336a2bde2ca627214c3 | [
"MIT"
] | null | null | null | lps36/header/header.py | JGabrielGruber/lps36 | 6a8894c880ab2d1e3faf7336a2bde2ca627214c3 | [
"MIT"
] | null | null | null | lps36/header/header.py | JGabrielGruber/lps36 | 6a8894c880ab2d1e3faf7336a2bde2ca627214c3 | [
"MIT"
] | null | null | null | from lps36.header.command import Command
from lps36.header.transaction import Transaction
from lps36.header.status import Status
from lps36.header.encoder import Encoder
from lps36.header.scan import Scan
from lps36.header.type import Type
from lps36.header.data import Data
class Header():
command: Command
t... | 22.842105 | 48 | 0.771889 | from lps36.header.command import Command
from lps36.header.transaction import Transaction
from lps36.header.status import Status
from lps36.header.encoder import Encoder
from lps36.header.scan import Scan
from lps36.header.type import Type
from lps36.header.data import Data
class Header():
command: Command
t... | true | true |
1c0c7c3727d2e841d66366141503c4663f7584cd | 355 | py | Python | Monkey-Leg/main.py | Ingener74/Remote-Monkey-Leg | 4c0a273d8499ca8276f3bbf8d409072ba30dd333 | [
"MIT"
] | null | null | null | Monkey-Leg/main.py | Ingener74/Remote-Monkey-Leg | 4c0a273d8499ca8276f3bbf8d409072ba30dd333 | [
"MIT"
] | null | null | null | Monkey-Leg/main.py | Ingener74/Remote-Monkey-Leg | 4c0a273d8499ca8276f3bbf8d409072ba30dd333 | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget
from widget import Ui_Widget
class Widget(QWidget, Ui_Widget):
def __init__(self, parent=None):
QWidget.__init__(self, parent, Qt.Window)
self.setupUi(self)
app = QApplication(sys.argv)
widget = Widget()
w... | 18.684211 | 49 | 0.729577 | import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget
from widget import Ui_Widget
class Widget(QWidget, Ui_Widget):
def __init__(self, parent=None):
QWidget.__init__(self, parent, Qt.Window)
self.setupUi(self)
app = QApplication(sys.argv)
widget = Widget()
w... | true | true |
1c0c7f5b8f61550f0b31c5cba4011631de611ea9 | 2,431 | py | Python | conftest.py | shtepkaa/SoftwareTesting | d3da30238d35cde84701bfdfa43c2db659404684 | [
"Apache-2.0"
] | null | null | null | conftest.py | shtepkaa/SoftwareTesting | d3da30238d35cde84701bfdfa43c2db659404684 | [
"Apache-2.0"
] | null | null | null | conftest.py | shtepkaa/SoftwareTesting | d3da30238d35cde84701bfdfa43c2db659404684 | [
"Apache-2.0"
] | 1 | 2021-08-10T14:36:00.000Z | 2021-08-10T14:36:00.000Z | import pytest
from fixture.application import Application
import json
import os.path
import importlib
import jsonpickle
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... | 28.940476 | 100 | 0.689017 | import pytest
from fixture.application import Application
import json
import os.path
import importlib
import jsonpickle
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... | true | true |
1c0c827df717ce13681603b86c32c70186a5a1db | 5,790 | py | Python | openstack/network/v2/quota.py | anton-sidelnikov/openstacksdk | 98f0c67120b65814c3bd1663415e302551a14536 | [
"Apache-2.0"
] | null | null | null | openstack/network/v2/quota.py | anton-sidelnikov/openstacksdk | 98f0c67120b65814c3bd1663415e302551a14536 | [
"Apache-2.0"
] | null | null | null | openstack/network/v2/quota.py | anton-sidelnikov/openstacksdk | 98f0c67120b65814c3bd1663415e302551a14536 | [
"Apache-2.0"
] | null | null | null | # 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
# distributed under t... | 43.863636 | 79 | 0.686528 |
from openstack import resource
class Quota(resource.Resource):
resource_key = 'quota'
resources_key = 'quotas'
base_path = '/quotas'
_allow_unknown_attrs_in_body = True
allow_fetch = True
allow_commit = True
allow_delete = True
allow_list = True
check_limit = resour... | true | true |
1c0c831e752d3c4bec8e350d4ac137cca0644cd9 | 3,371 | py | Python | apps/beeswax/src/beeswax/urls.py | jesman/hue | 21edfc1b790510e512216ab5cc8aeb1a84255de3 | [
"Apache-2.0"
] | 1 | 2018-02-19T15:21:27.000Z | 2018-02-19T15:21:27.000Z | apps/beeswax/src/beeswax/urls.py | jesman/hue | 21edfc1b790510e512216ab5cc8aeb1a84255de3 | [
"Apache-2.0"
] | null | null | null | apps/beeswax/src/beeswax/urls.py | jesman/hue | 21edfc1b790510e512216ab5cc8aeb1a84255de3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 51.075758 | 120 | 0.712548 |
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('beeswax.views',
url(r'^$', 'index', name='index'),
url(r'^execute/(?P<design_id>\d+)?$', 'execute_query', name='execute_query'),
url(r'^explain_parameterized/(?P<design_id>\d+)$', 'explain_parameterized_query', name='explain_parameteri... | true | true |
1c0c83630fef566cb08c2f684aab3a43618a195f | 2,948 | py | Python | pyram/matrc.py | marcuskd/pyram | 9c3ad1d2ccb131cd819bdd2d75d9f57538738e8f | [
"BSD-3-Clause"
] | 7 | 2018-12-12T16:35:09.000Z | 2022-03-04T01:16:28.000Z | pyram/matrc.py | marcuskd/pyram | 9c3ad1d2ccb131cd819bdd2d75d9f57538738e8f | [
"BSD-3-Clause"
] | 1 | 2020-05-06T09:06:15.000Z | 2020-10-20T15:54:46.000Z | pyram/matrc.py | marcuskd/pyram | 9c3ad1d2ccb131cd819bdd2d75d9f57538738e8f | [
"BSD-3-Clause"
] | 5 | 2019-03-03T03:23:43.000Z | 2022-03-04T01:15:59.000Z | '''solve function definition'''
from numba import jit, float64, int64, complex128
@jit((float64, float64, int64, int64, int64, int64, float64[:], float64[:],
float64[:], complex128[:], float64[:], float64[:], float64[:],
complex128[:], float64[:], complex128[:, :], complex128[:, :],
complex128[:, :], ... | 31.031579 | 76 | 0.400271 |
from numba import jit, float64, int64, complex128
@jit((float64, float64, int64, int64, int64, int64, float64[:], float64[:],
float64[:], complex128[:], float64[:], float64[:], float64[:],
complex128[:], float64[:], complex128[:, :], complex128[:, :],
complex128[:, :], complex128[:, :], complex128[:, ... | true | true |
1c0c85b7694656ed2f78d0400483eef2b523bb04 | 420 | py | Python | test_config.py | tjurkiewicz/listing-agent | 89f4f4d4de0ff43f43ff620b44654e7ca2e68a1e | [
"MIT"
] | null | null | null | test_config.py | tjurkiewicz/listing-agent | 89f4f4d4de0ff43f43ff620b44654e7ca2e68a1e | [
"MIT"
] | null | null | null | test_config.py | tjurkiewicz/listing-agent | 89f4f4d4de0ff43f43ff620b44654e7ca2e68a1e | [
"MIT"
] | null | null | null | import config
def test_config():
conf = config.get_config('test_data/config.ini')
assert conf['SQLDatabase']['Connection'] == 'driver://db:db@localhost/db'
assert conf['Queue']['Host'] == 'localhost'
assert conf['Queue']['Username'] == 'username'
assert conf['Queue']['Password'] == 'password'
... | 32.307692 | 77 | 0.642857 | import config
def test_config():
conf = config.get_config('test_data/config.ini')
assert conf['SQLDatabase']['Connection'] == 'driver://db:db@localhost/db'
assert conf['Queue']['Host'] == 'localhost'
assert conf['Queue']['Username'] == 'username'
assert conf['Queue']['Password'] == 'password'
... | true | true |
1c0c860ba804d7dc8f495b607c3a1c4d3318b1bd | 5,298 | py | Python | Cogs/Morse.py | camielverdult/CorpBot.py | 56cf3ee736625525d05f9f447b31e34baf93596d | [
"MIT"
] | null | null | null | Cogs/Morse.py | camielverdult/CorpBot.py | 56cf3ee736625525d05f9f447b31e34baf93596d | [
"MIT"
] | null | null | null | Cogs/Morse.py | camielverdult/CorpBot.py | 56cf3ee736625525d05f9f447b31e34baf93596d | [
"MIT"
] | null | null | null | import asyncio
import discord
from discord.ext import commands
from operator import itemgetter
import base64
import binascii
import re
from Cogs import Utils
def setup(bot):
# Add the bot and deps
settings = bot.get_cog("Settings")
bot.add_cog(Morse(bot, settings))
class Morse(commands.Cog):
# Init... | 32.109091 | 168 | 0.463949 | import asyncio
import discord
from discord.ext import commands
from operator import itemgetter
import base64
import binascii
import re
from Cogs import Utils
def setup(bot):
settings = bot.get_cog("Settings")
bot.add_cog(Morse(bot, settings))
class Morse(commands.Cog):
def __init__(self, bot, s... | true | true |
1c0c865ce8dfd37aa7b09628c0ac915fce6d0a7f | 1,733 | py | Python | anime_downloader/sites/dubbedanime.py | ngomile/anime-downloader | 14d9cebe8aa4eb9d906b937d7c19fedfa737d184 | [
"Unlicense"
] | 2 | 2020-08-10T12:34:42.000Z | 2020-11-19T08:13:48.000Z | anime_downloader/sites/dubbedanime.py | ngomile/anime-downloader | 14d9cebe8aa4eb9d906b937d7c19fedfa737d184 | [
"Unlicense"
] | null | null | null | anime_downloader/sites/dubbedanime.py | ngomile/anime-downloader | 14d9cebe8aa4eb9d906b937d7c19fedfa737d184 | [
"Unlicense"
] | null | null | null | import logging
import re
from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers
class Dubbedanime(Anime, sitename='dubbedanime'):
sitename = 'dubbedanime'
url = f'https://{sitename}.net'
@classmethod
def search(cls, query):... | 37.673913 | 88 | 0.542989 | import logging
import re
from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers
class Dubbedanime(Anime, sitename='dubbedanime'):
sitename = 'dubbedanime'
url = f'https://{sitename}.net'
@classmethod
def search(cls, query):... | true | true |
1c0c87907aab646683a657e1c43f4528c58b6357 | 801 | py | Python | paddlenlp/utils/import_utils.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/utils/import_utils.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/utils/import_utils.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 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 applic... | 38.142857 | 74 | 0.775281 |
import importlib.util
def is_faster_tokenizer_available():
package_spec = importlib.util.find_spec("faster_tokenizer")
return package_spec is not None and package_spec.has_location
| true | true |
1c0c880c23b4f318ad814e70f8f45f2c309330c6 | 3,219 | py | Python | socialraspi.py | makersinchicago/socialraspi | 628f2555d4163e68fa97134c8507c3db77e93e7a | [
"Apache-2.0"
] | 1 | 2022-02-01T19:20:53.000Z | 2022-02-01T19:20:53.000Z | socialraspi.py | makersinchicago/socialraspi | 628f2555d4163e68fa97134c8507c3db77e93e7a | [
"Apache-2.0"
] | null | null | null | socialraspi.py | makersinchicago/socialraspi | 628f2555d4163e68fa97134c8507c3db77e93e7a | [
"Apache-2.0"
] | null | null | null | """
at boot, present prompt
wait for user input
at user input, record 1 minute of video and audio using picam
after recording is done, present prompt. user may play back video or record anew
if the user is satisfied, they may press send to post the video to makersinchicago's twitter timeline, the chimakerfest's ig... | 36.579545 | 166 | 0.579994 |
import alsaaudio, wave, numpy
import os
from picamera import PiCamera
from time import sleep
import picamera.array
from gpiozero import Button
import subprocess
from keys import (
image,
)
snapButton = Button(27)
vidButton = Button(23)
exitButton = Button(17)
tracktime = 2832
with picamera.PiCamera() as camera... | true | true |
1c0c8947f22bbc9d84c48099220e69e21c4dd619 | 5,608 | py | Python | edsm.py | Findarato/personal-influxdb | 1d41f12b1e4a4f46a8cb7552339e09838676b67f | [
"Apache-2.0"
] | 3 | 2019-12-12T17:29:14.000Z | 2019-12-12T21:00:05.000Z | edsm.py | Findarato/personal-influxdb | 1d41f12b1e4a4f46a8cb7552339e09838676b67f | [
"Apache-2.0"
] | null | null | null | edsm.py | Findarato/personal-influxdb | 1d41f12b1e4a4f46a8cb7552339e09838676b67f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# Copyright 2022 Sam Steele
#
# 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 a... | 31.683616 | 104 | 0.598252 |
import requests, requests_cache, sys, math, logging
from datetime import datetime, date
from config import *
if not EDSM_API_KEY:
logging.error("EDSM_API_KEY not set in config.py")
sys.exit(1)
points = []
last = None
def add_rank(data, activity):
global points
points.append({
"measurement": ... | true | true |
1c0c89ca887227072f04c6ea40b14512a175c21e | 10,077 | py | Python | dependencies/panda/Panda3D-1.10.0-x64/direct/directdevices/DirectDeviceManager.py | CrankySupertoon01/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 3 | 2018-03-09T12:07:29.000Z | 2021-02-25T06:50:25.000Z | direct/src/directdevices/DirectDeviceManager.py | Sinkay/panda3d | 16bfd3750f726a8831771b81649d18d087917fd5 | [
"PHP-3.01",
"PHP-3.0"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | direct/src/directdevices/DirectDeviceManager.py | Sinkay/panda3d | 16bfd3750f726a8831771b81649d18d087917fd5 | [
"PHP-3.01",
"PHP-3.0"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | """ Class used to create and control vrpn devices """
from direct.showbase.DirectObject import DirectObject
from panda3d.core import *
from panda3d.vrpn import *
ANALOG_MIN = -0.95
ANALOG_MAX = 0.95
ANALOG_DEADBAND = 0.125
ANALOG_CENTER = 0.0
try:
myBase = base
except:
myBase = simbase
class DirectDeviceMan... | 33.815436 | 78 | 0.59611 |
from direct.showbase.DirectObject import DirectObject
from panda3d.core import *
from panda3d.vrpn import *
ANALOG_MIN = -0.95
ANALOG_MAX = 0.95
ANALOG_DEADBAND = 0.125
ANALOG_CENTER = 0.0
try:
myBase = base
except:
myBase = simbase
class DirectDeviceManager(VrpnClient, DirectObject):
def __init__(self,... | true | true |
1c0c8a3ea94d63d1d00fb3c0e3b1cf7a2dabd5ae | 649 | py | Python | apps/gridportal/base/Grid/.macros/wiki/workersjobs/3_workersjobs.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | 1 | 2015-10-26T10:38:13.000Z | 2015-10-26T10:38:13.000Z | apps/gridportal/base/Grid/.macros/wiki/workersjobs/3_workersjobs.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | apps/gridportal/base/Grid/.macros/wiki/workersjobs/3_workersjobs.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | def main(j, args, params, tags, tasklet):
import JumpScale.grid.agentcontroller
doc = args.doc
nid = args.getTag('nid')
out = list()
out.append("{{datatables_use}}}}\n")
out.append('||ID||State||Queue||Category||Command||JScriptID||Start time||Stop time||')
workerscl = j.clients.agentcont... | 27.041667 | 91 | 0.647149 | def main(j, args, params, tags, tasklet):
import JumpScale.grid.agentcontroller
doc = args.doc
nid = args.getTag('nid')
out = list()
out.append("{{datatables_use}}}}\n")
out.append('||ID||State||Queue||Category||Command||JScriptID||Start time||Stop time||')
workerscl = j.clients.agentcont... | true | true |
1c0c8a8dab2baf04eff01f084d8f4d1d4ea15358 | 5,579 | py | Python | opta/commands/deploy.py | riddopic/opta | 25fa6435fdc7e2ea9c7963ed74100fffb0743063 | [
"Apache-2.0"
] | null | null | null | opta/commands/deploy.py | riddopic/opta | 25fa6435fdc7e2ea9c7963ed74100fffb0743063 | [
"Apache-2.0"
] | null | null | null | opta/commands/deploy.py | riddopic/opta | 25fa6435fdc7e2ea9c7963ed74100fffb0743063 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List, Optional
import click
from opta.amplitude import amplitude_client
from opta.commands.apply import _apply, local_setup
from opta.commands.push import is_service_config, push_image
from opta.core.terraform import Terraform
from opta.error_constants import USER_ERROR_TF_LOCK
from opta.exce... | 32.817647 | 116 | 0.626456 | from typing import Dict, List, Optional
import click
from opta.amplitude import amplitude_client
from opta.commands.apply import _apply, local_setup
from opta.commands.push import is_service_config, push_image
from opta.core.terraform import Terraform
from opta.error_constants import USER_ERROR_TF_LOCK
from opta.exce... | true | true |
1c0c8ab38eac12865e7b942729fa3b3c06d51045 | 693 | py | Python | python.py | priyankakushi/machine-learning | f46e077cc6d52a25a2f4ec3576791369ed091d51 | [
"CC-BY-3.0"
] | null | null | null | python.py | priyankakushi/machine-learning | f46e077cc6d52a25a2f4ec3576791369ed091d51 | [
"CC-BY-3.0"
] | null | null | null | python.py | priyankakushi/machine-learning | f46e077cc6d52a25a2f4ec3576791369ed091d51 | [
"CC-BY-3.0"
] | null | null | null | a = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,45,65,78,39,45,48, 45, 97, 108, 354647, 3453452435, 342534]
#number dyvide by 2 = priyanka, divide by 3 = amit, divide = 2&3 = soni
#1,priyanka, amit, priyanka, 5, soni
def converter(bar):
limi = []
for pri in bar:
if pri%2 == 0 and pri%3 == 0 :
... | 21 | 115 | 0.516595 | a = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,45,65,78,39,45,48, 45, 97, 108, 354647, 3453452435, 342534]
def converter(bar):
limi = []
for pri in bar:
if pri%2 == 0 and pri%3 == 0 :
limi.append("soni")
elif pri%3==0:
limi.append("amit")... | true | true |
1c0c8b2ccce9e6019a4f79502cffa4162a0772b5 | 311 | py | Python | modopt/base/__init__.py | paquiteau/ModOpt | d050b665b28d39a7e69a783d957ddb1af6f1028c | [
"MIT"
] | 21 | 2018-03-16T14:42:49.000Z | 2022-02-14T12:27:32.000Z | modopt/base/__init__.py | paquiteau/ModOpt | d050b665b28d39a7e69a783d957ddb1af6f1028c | [
"MIT"
] | 181 | 2018-03-20T07:51:41.000Z | 2022-03-31T16:26:34.000Z | modopt/base/__init__.py | paquiteau/ModOpt | d050b665b28d39a7e69a783d957ddb1af6f1028c | [
"MIT"
] | 13 | 2018-03-19T14:54:47.000Z | 2021-12-20T12:36:05.000Z | # -*- coding: utf-8 -*-
"""BASE ROUTINES.
This module contains submodules for basic operations such as type
transformations and adjustments to the default output of Numpy functions.
:Author: Samuel Farrens <samuel.farrens@cea.fr>
"""
__all__ = ['np_adjust', 'transform', 'types', 'wrappers', 'observable']
| 23.923077 | 73 | 0.726688 |
__all__ = ['np_adjust', 'transform', 'types', 'wrappers', 'observable']
| true | true |
1c0c8b301bec5568d53e9cd88b1018e7930d689b | 2,120 | py | Python | scripts/random_agent_sim.py | akeaveny/robo-gym | 9ad8cf2e7adf12062b1bc5e62afb2938f70d02a9 | [
"MIT"
] | null | null | null | scripts/random_agent_sim.py | akeaveny/robo-gym | 9ad8cf2e7adf12062b1bc5e62afb2938f70d02a9 | [
"MIT"
] | null | null | null | scripts/random_agent_sim.py | akeaveny/robo-gym | 9ad8cf2e7adf12062b1bc5e62afb2938f70d02a9 | [
"MIT"
] | null | null | null | import gym
from gym.wrappers import TimeLimit
from gym.wrappers import FlattenObservation
import robo_gym
from robo_gym.wrappers.exception_handling import ExceptionHandling
from robo_gym.wrappers.flatten_action_space import FlattenAction
target_machine_ip = 'localhost' # or other machine 'xxx.xxx.xxx.xxx'
import num... | 27.532468 | 90 | 0.588679 | import gym
from gym.wrappers import TimeLimit
from gym.wrappers import FlattenObservation
import robo_gym
from robo_gym.wrappers.exception_handling import ExceptionHandling
from robo_gym.wrappers.flatten_action_space import FlattenAction
target_machine_ip = 'localhost'
import numpy as np
import pprint
import conf... | true | true |
1c0c8b9c2f052973f4898cceb40c6ee008dbbe86 | 1,740 | py | Python | sw/ice40_usage.py | Barabas5532/no2build | d9d7a5db11c788e6cba9f4b28f47c3ee56f6cfad | [
"BSD-3-Clause"
] | 4 | 2020-10-04T09:03:42.000Z | 2021-12-20T13:01:06.000Z | sw/ice40_usage.py | Barabas5532/no2build | d9d7a5db11c788e6cba9f4b28f47c3ee56f6cfad | [
"BSD-3-Clause"
] | null | null | null | sw/ice40_usage.py | Barabas5532/no2build | d9d7a5db11c788e6cba9f4b28f47c3ee56f6cfad | [
"BSD-3-Clause"
] | 1 | 2021-02-28T21:15:16.000Z | 2021-02-28T21:15:16.000Z | #!/usr/bin/env python3
#
# Show usage post-pack
#
# Copyright (C) 2020 Sylvain Munaut
# SPDX-License-Identifier: MIT
#
CELLS = {
'ICESTORM_LC': ( 'LC', 5),
'ICESTORM_RAM': ( 'RAM', 2),
'ICESTORM_DSP': ( 'DSP', 1),
'ICESTORM_SPRAM': ('SPRAM', 1),
}
class UsageTracker:
def __init__(self):
self.usage... | 18.125 | 52 | 0.536207 |
CELLS = {
'ICESTORM_LC': ( 'LC', 5),
'ICESTORM_RAM': ( 'RAM', 2),
'ICESTORM_DSP': ( 'DSP', 1),
'ICESTORM_SPRAM': ('SPRAM', 1),
}
class UsageTracker:
def __init__(self):
self.usage = {}
def add_cell(self, c):
if c.type not in CELLS:
return
# Path & element name
path = c.name.split('.'... | true | true |
1c0c8bc77ae38891e0c63e46277a8140dee7fb31 | 5,857 | py | Python | GhostXML.indigoPlugin/Contents/Server Plugin/iterateXML.py | IndigoDomotics/GhostXML | 2fa1b62af6bbd91cdd5e9f3fae7889ca0b40ee1d | [
"MIT"
] | 2 | 2016-11-27T22:14:55.000Z | 2019-10-29T19:18:54.000Z | GhostXML.indigoPlugin/Contents/Server Plugin/iterateXML.py | IndigoDomotics/GhostXML | 2fa1b62af6bbd91cdd5e9f3fae7889ca0b40ee1d | [
"MIT"
] | 2 | 2016-11-28T23:18:50.000Z | 2016-11-30T04:22:33.000Z | GhostXML.indigoPlugin/Contents/Server Plugin/iterateXML.py | IndigoDomotics/GhostXML | 2fa1b62af6bbd91cdd5e9f3fae7889ca0b40ee1d | [
"MIT"
] | 2 | 2016-11-27T22:14:47.000Z | 2018-12-06T05:57:38.000Z | #! /usr/bin/env python2.5
# -*- coding: utf-8 -*-
"""
This module receives the XML data as a string and returns a dictionary (finalDict)
which contains key/value pairs which represent the source XML. It is an amalgam of
bits and pieces across the web.
Credit for XmlDictConfig(): http://code.activestate.com/recipes/41... | 39.046667 | 115 | 0.551477 |
import xml.etree.ElementTree as ElementTree
try:
import indigo
except ImportError:
pass
class XmlDictConfig(dict):
def __init__(self, parent_element):
super(XmlDictConfig, self).__init__()
if parent_element.items():
self.updateShim(dict(parent_element.items()))
fo... | true | true |
1c0c8d49c891a9fb123052a48db5f8b49ff8695a | 4,684 | py | Python | extra_test/processWordFarabi.py | iut-160041010/Teaching-Assistant-for-Kids-using-OCR | 071fa6acd597f8c4439f2f0c0e2e4eef5588f079 | [
"CC0-1.0"
] | null | null | null | extra_test/processWordFarabi.py | iut-160041010/Teaching-Assistant-for-Kids-using-OCR | 071fa6acd597f8c4439f2f0c0e2e4eef5588f079 | [
"CC0-1.0"
] | 1 | 2021-09-01T03:57:28.000Z | 2021-09-01T03:57:28.000Z | extra_test/processWordFarabi.py | zahid58/Tsaurus-teaching-assistant-for-Kids-using-OCR-and-webscrapping | 071fa6acd597f8c4439f2f0c0e2e4eef5588f079 | [
"CC0-1.0"
] | 1 | 2019-04-05T12:09:34.000Z | 2019-04-05T12:09:34.000Z | from requests import get as reqGet
from bs4 import BeautifulSoup
from os import getcwd, path
from json import loads as jloads
import threading
import sys
from database import dbobject
cwd = getcwd()
savedir = path.join(path.dirname(cwd) + "\\Tsaurus-teaching-assistant-for-Kids-using-OCR-and-webscrapping\\tem... | 33.697842 | 193 | 0.510248 | from requests import get as reqGet
from bs4 import BeautifulSoup
from os import getcwd, path
from json import loads as jloads
import threading
import sys
from database import dbobject
cwd = getcwd()
savedir = path.join(path.dirname(cwd) + "\\Tsaurus-teaching-assistant-for-Kids-using-OCR-and-webscrapping\\tem... | true | true |
1c0c8dec28f783330903a5609afed827f2df821e | 7,305 | py | Python | cachier/pickle_core.py | benzlock/cachier | 95edb3a023bc5ca46da118f3aa9656fea9722258 | [
"MIT"
] | null | null | null | cachier/pickle_core.py | benzlock/cachier | 95edb3a023bc5ca46da118f3aa9656fea9722258 | [
"MIT"
] | null | null | null | cachier/pickle_core.py | benzlock/cachier | 95edb3a023bc5ca46da118f3aa9656fea9722258 | [
"MIT"
] | null | null | null | """A pickle-based caching core for cachier."""
# This file is part of Cachier.
# https://github.com/shaypal5/cachier
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2016, Shay Palachy <shaypal5@gmail.com>
import os
import pickle # for local caching
from datetime im... | 33.356164 | 117 | 0.562491 |
import os
import pickle from datetime import datetime
import threading
import portalocker from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
from .base_core import _BaseCore, _Sentinel
DEF_CACHIER_DIR = '~/.cachier/'
class _PickleCore(_BaseCore):
class Cache... | true | true |
1c0c8e0d374244c845de5aeae74154d6bfe3082e | 2,745 | py | Python | tests/test_sitemap.py | byteface/domonic | 971c2ae6ce2253e302873d40fd5b6e46a8f9ca95 | [
"MIT"
] | 94 | 2020-07-12T12:02:07.000Z | 2022-03-25T03:04:57.000Z | tests/test_sitemap.py | byteface/domonic | 971c2ae6ce2253e302873d40fd5b6e46a8f9ca95 | [
"MIT"
] | 41 | 2021-06-02T10:51:58.000Z | 2022-02-21T09:58:43.000Z | tests/test_sitemap.py | byteface/domonic | 971c2ae6ce2253e302873d40fd5b6e46a8f9ca95 | [
"MIT"
] | 17 | 2021-06-10T00:34:27.000Z | 2022-02-21T09:47:30.000Z | """
test_sitemap
~~~~~~~~~~~~
"""
import unittest
# import requests
# from mock import patch
from datetime import datetime
from domonic import domonic
from domonic.xml.sitemap import *
from domonic.decorators import silence
class TestCase(unittest.TestCase):
# @silence
def test_sitemap(self):
... | 29.516129 | 131 | 0.591621 |
import unittest
from datetime import datetime
from domonic import domonic
from domonic.xml.sitemap import *
from domonic.decorators import silence
class TestCase(unittest.TestCase):
def test_sitemap(self):
doc = sitemapindex(
sitemap(
loc('https://x.net/egypt/p... | true | true |
1c0c8e19107583d91e925ee691fe0975138a8aa8 | 2,079 | py | Python | test/nicos_sinq/boa/test_counterrotation.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | test/nicos_sinq/boa/test_counterrotation.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | test/nicos_sinq/boa/test_counterrotation.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 28.479452 | 79 | 0.600289 |
session_setup = 'sinq_counterrotation'
def test_counterrot1(session):
rbu = session.getDevice('rbu')
rb = session.getDevice('rb')
rc = session.getDevice('rc')
rb.maw(3)
rc.maw(0)
rbu.maw(5.)
assert rbu.read() == 5.
assert rb.read() == 8.
assert rc.read() == -5.
rbu.maw(7)
... | true | true |
1c0c9091e96574c6462d57b3877cafa7574a847c | 2,360 | py | Python | xbox360.py | dstenb/retroarch-bindings-creator | 546ac93c0ac50e075ade550bc10ce6ef1c63b41c | [
"MIT"
] | 1 | 2018-11-22T04:35:34.000Z | 2018-11-22T04:35:34.000Z | xbox360.py | dstenb/retroarch-bindings-creator | 546ac93c0ac50e075ade550bc10ce6ef1c63b41c | [
"MIT"
] | null | null | null | xbox360.py | dstenb/retroarch-bindings-creator | 546ac93c0ac50e075ade550bc10ce6ef1c63b41c | [
"MIT"
] | null | null | null | XBOX360_UDEV_MAPPING = {
"A": "0",
"B": "1",
"X": "2",
"Y": "3",
"Select": "6",
"Start": "7",
"D up": "13",
"D down": "14",
"D left": "11",
"D right": "12",
"L": "4",
"R": "5",
"LT": "+2",
"RT": "+5",
"Xbox": "8",
"L analog left": "-0",
"L analog right... | 23.6 | 61 | 0.515254 | XBOX360_UDEV_MAPPING = {
"A": "0",
"B": "1",
"X": "2",
"Y": "3",
"Select": "6",
"Start": "7",
"D up": "13",
"D down": "14",
"D left": "11",
"D right": "12",
"L": "4",
"R": "5",
"LT": "+2",
"RT": "+5",
"Xbox": "8",
"L analog left": "-0",
"L analog right... | true | true |
1c0c9168a73d12a68a82b87862f4b3e81fbfb716 | 98 | py | Python | login.py | gaozhuoquan/py3 | f983f54052d1965807758165e35328272158c9c2 | [
"MIT"
] | null | null | null | login.py | gaozhuoquan/py3 | f983f54052d1965807758165e35328272158c9c2 | [
"MIT"
] | null | null | null | login.py | gaozhuoquan/py3 | f983f54052d1965807758165e35328272158c9c2 | [
"MIT"
] | null | null | null | print("zhangsan1")
print("manager1")
print("manger22")
print("zhangsan2")
print("manager last")
| 12.25 | 21 | 0.714286 | print("zhangsan1")
print("manager1")
print("manger22")
print("zhangsan2")
print("manager last")
| true | true |
1c0c91d9d22a65bc92dfa1a3e429c4e1c2fbb2c4 | 948 | py | Python | src/compas_slicer/utilities/__init__.py | stratocaster/compas_slicer | 10326507d6d4093f0dfee8582a6d2f4f3b68d1a5 | [
"MIT"
] | null | null | null | src/compas_slicer/utilities/__init__.py | stratocaster/compas_slicer | 10326507d6d4093f0dfee8582a6d2f4f3b68d1a5 | [
"MIT"
] | null | null | null | src/compas_slicer/utilities/__init__.py | stratocaster/compas_slicer | 10326507d6d4093f0dfee8582a6d2f4f3b68d1a5 | [
"MIT"
] | null | null | null | """
********************************************************************************
utilities
********************************************************************************
.. currentmodule:: compas_slicer.utilities
utils
=========
.. autosummary::
:toctree: generated/
:nosignatures:
save_to_json
... | 23.121951 | 80 | 0.629747 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .utils import * from .terminal_command import *
__all__ = [name for name in dir() if not name.startswith('_')]
| true | true |
1c0c935382e0b843b777ba786db8fbf5eb7bbf28 | 5,938 | py | Python | sail_on_client/agent/mock_condda_agents.py | darpa-sail-on/sail-on-client | 1fd7c0ec359469040fd7af0c8e56fe53277d4a27 | [
"Apache-2.0"
] | 1 | 2021-04-12T17:20:54.000Z | 2021-04-12T17:20:54.000Z | sail_on_client/agent/mock_condda_agents.py | darpa-sail-on/sail-on-client | 1fd7c0ec359469040fd7af0c8e56fe53277d4a27 | [
"Apache-2.0"
] | 92 | 2021-03-08T22:32:15.000Z | 2022-03-25T03:53:01.000Z | sail_on_client/agent/mock_condda_agents.py | darpa-sail-on/sail-on-client | 1fd7c0ec359469040fd7af0c8e56fe53277d4a27 | [
"Apache-2.0"
] | null | null | null | """Mocks mainly used for testing CONDDA."""
from sail_on_client.checkpointer import Checkpointer
from sail_on_client.agent.condda_agent import CONDDAAgent
from typing import Dict, Any, Tuple, Callable
import logging
import os
import shutil
import torch
log = logging.getLogger(__name__)
class MockCONDDAAgent(CONDDA... | 29.839196 | 85 | 0.613675 |
from sail_on_client.checkpointer import Checkpointer
from sail_on_client.agent.condda_agent import CONDDAAgent
from typing import Dict, Any, Tuple, Callable
import logging
import os
import shutil
import torch
log = logging.getLogger(__name__)
class MockCONDDAAgent(CONDDAAgent):
def __init__(self) -> None:
... | true | true |
1c0c943c71b2eea391e5a6bf75ed7469d50d135f | 1,078 | py | Python | components/nyc-taxi-fare-prediction/merge/merge.py | isabella232/AzureMachineLearningGallery | 7e8fe77f247410f21e0c550592ef5104c9e0f05c | [
"MIT"
] | null | null | null | components/nyc-taxi-fare-prediction/merge/merge.py | isabella232/AzureMachineLearningGallery | 7e8fe77f247410f21e0c550592ef5104c9e0f05c | [
"MIT"
] | 1 | 2021-02-23T23:56:58.000Z | 2021-02-24T00:06:44.000Z | components/nyc-taxi-fare-prediction/merge/merge.py | isabella232/AzureMachineLearningGallery | 7e8fe77f247410f21e0c550592ef5104c9e0f05c | [
"MIT"
] | null | null | null | import argparse
import os
from azureml.studio.core.io.data_frame_directory import load_data_frame_from_directory, save_data_frame_to_directory
print("Merge Green and Yellow taxi data")
parser = argparse.ArgumentParser("merge")
parser.add_argument("--cleansed_green_data", type=str, help="cleansed green data")
parser.a... | 44.916667 | 116 | 0.80705 | import argparse
import os
from azureml.studio.core.io.data_frame_directory import load_data_frame_from_directory, save_data_frame_to_directory
print("Merge Green and Yellow taxi data")
parser = argparse.ArgumentParser("merge")
parser.add_argument("--cleansed_green_data", type=str, help="cleansed green data")
parser.a... | true | true |
1c0c94a10e666f600efd5de7cff2926c40bdbdf4 | 427 | py | Python | backend/ideapros_llc_tangle_34213/wsgi.py | crowdbotics-apps/ideapros-llc-tangle-34213 | f87fa13b1b1ca9c3323454af160b28c15d3e07ff | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/ideapros_llc_tangle_34213/wsgi.py | crowdbotics-apps/ideapros-llc-tangle-34213 | f87fa13b1b1ca9c3323454af160b28c15d3e07ff | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/ideapros_llc_tangle_34213/wsgi.py | crowdbotics-apps/ideapros-llc-tangle-34213 | f87fa13b1b1ca9c3323454af160b28c15d3e07ff | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for ideapros_llc_tangle_34213 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/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdef... | 25.117647 | 85 | 0.803279 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ideapros_llc_tangle_34213.settings')
application = get_wsgi_application()
| true | true |
1c0c94a1d04c20ea374c86264923c5b3c2c792d6 | 629 | py | Python | 83.remove-duplicates-from-sorted-list.py | leonhx/leetcode-practice | 35fabe5a1b98c05a5dd5d6a62201e9cb54be69ec | [
"MIT"
] | null | null | null | 83.remove-duplicates-from-sorted-list.py | leonhx/leetcode-practice | 35fabe5a1b98c05a5dd5d6a62201e9cb54be69ec | [
"MIT"
] | null | null | null | 83.remove-duplicates-from-sorted-list.py | leonhx/leetcode-practice | 35fabe5a1b98c05a5dd5d6a62201e9cb54be69ec | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=83 lang=python3
#
# [83] Remove Duplicates from Sorted List
#
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def _deleteNode(self, head: ListNode, val) -> ListNode:
if head is None... | 27.347826 | 59 | 0.624801 |
class Solution:
def _deleteNode(self, head: ListNode, val) -> ListNode:
if head is None:
return head
if val is not None and val == head.val:
return self._deleteNode(head.next, val)
head.next = self._deleteNode(head.next, head.val)
return head
def deleteD... | true | true |
1c0c94d7d3cb733de017c4755251c1f843e070cd | 8,270 | py | Python | qiskit/circuit/library/standard_gates/swap.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/standard_gates/swap.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/standard_gates/swap.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | 1 | 2020-07-13T17:56:46.000Z | 2020-07-13T17:56:46.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 32.178988 | 99 | 0.474486 |
import numpy
from qiskit.circuit.controlledgate import ControlledGate
from qiskit.circuit.gate import Gate
from qiskit.circuit.quantumregister import QuantumRegister
class SwapGate(Gate):
def __init__(self, label=None):
super().__init__('swap', 2, [], label=label)
def _define(self):
... | true | true |
1c0c94e9ec14311ebbfc8c4feb107e1475c22ef2 | 4,576 | py | Python | build/PureCloudPlatformClientV2/models/week_shift_trade_response.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 10 | 2019-02-22T00:27:08.000Z | 2021-09-12T23:23:44.000Z | libs/PureCloudPlatformClientV2/models/week_shift_trade_response.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 5 | 2018-06-07T08:32:00.000Z | 2021-07-28T17:37:26.000Z | libs/PureCloudPlatformClientV2/models/week_shift_trade_response.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 6 | 2020-04-09T17:43:07.000Z | 2022-02-17T08:48:05.000Z | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 29.146497 | 105 | 0.592876 |
from pprint import pformat
from six import iteritems
import re
import json
from ..utils import sanitize_for_serialization
class WeekShiftTradeResponse(object):
def __init__(self):
self.swagger_types = {
'trade': 'ShiftTradeResponse',
'match_review': 'ShiftTradeMatchReviewResponse... | true | true |
1c0c956a8757473afe0cb7d7627fd419ac045c7c | 1,840 | py | Python | leo/plugins/leomylyn.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | leo/plugins/leomylyn.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | leo/plugins/leomylyn.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | #@+leo-ver=5-thin
#@+node:ville.20120503224623.3574: * @file leomylyn.py
''' Provides an experience like Mylyn:http://en.wikipedia.org/wiki/Mylyn for Leo.
It "scores" the nodes based on how interesting they probably are for you,
allowing you to focus on your "working set".
Scoring is based on how much you edit the no... | 27.462687 | 81 | 0.62337 |
import leo.core.leoGlobals as g
def init ():
ok = g.app.gui.guiName() == "qt"
g.plugin_signon(__name__)
g._mylyn = ctr = MylynController()
ctr.set_handlers()
return ok
class MylynController(object):
def __init__(self):
self.scoring = {}
def add_score(self, v, points):
... | true | true |
1c0c959a3da4b4c209e1ad080e3106c492250b32 | 10,974 | py | Python | app/gallery.py | zmyaro/wave-extensions-gallery | e04541bf76fc504f33fab70c13b6262553ecdace | [
"CC-BY-3.0"
] | 1 | 2017-03-07T01:11:46.000Z | 2017-03-07T01:11:46.000Z | app/gallery.py | zmyaro/wave-extensions-gallery | e04541bf76fc504f33fab70c13b6262553ecdace | [
"CC-BY-3.0"
] | 1 | 2017-03-09T04:09:28.000Z | 2017-05-16T13:17:56.000Z | app/gallery.py | zmyaro/wave-extensions-gallery | e04541bf76fc504f33fab70c13b6262553ecdace | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import cgi
import os
from google.appengine.api import search
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
from constants import *
from... | 36.098684 | 101 | 0.677328 |
import cgi
import os
from google.appengine.api import search
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
from constants import *
from datastore import Extension,Rating,User
fr... | true | true |
1c0c96c041fb7434d0e0a176287184d7b72754c1 | 1,452 | py | Python | Utility/Utility.py | RahatIbnRafiq/CyberSafetySystem | 314655ddd27dd7232d79fedc045b4eb266e7f96d | [
"FSFAP"
] | null | null | null | Utility/Utility.py | RahatIbnRafiq/CyberSafetySystem | 314655ddd27dd7232d79fedc045b4eb266e7f96d | [
"FSFAP"
] | null | null | null | Utility/Utility.py | RahatIbnRafiq/CyberSafetySystem | 314655ddd27dd7232d79fedc045b4eb266e7f96d | [
"FSFAP"
] | null | null | null | '''
Created on Nov 11, 2016
@author: RahatIbnRafiq
'''
import DatabaseCodes.mongoOperations as dc
from mediaSession import MediaSession as mediasession
import re
from SentimentExtraction import SentimentExtraction as st
rootpath = "C:\\Users\\RahatIbnRafiq\\workspace\\CyberSafetySystem\\"
def getNewPostsForPredict... | 33 | 106 | 0.673554 |
import DatabaseCodes.mongoOperations as dc
from mediaSession import MediaSession as mediasession
import re
from SentimentExtraction import SentimentExtraction as st
rootpath = "C:\\Users\\RahatIbnRafiq\\workspace\\CyberSafetySystem\\"
def getNewPostsForPrediction():
toBePredicted = []
posts = dc.findAllData... | true | true |
1c0c9745c07e39ff535a2552025388393125768f | 1,427 | py | Python | test/test_functions.py | d9w/pyCGP | 8f23bda9d653b9def91e108e7fdad61c029178e1 | [
"MIT"
] | 1 | 2019-05-29T07:38:06.000Z | 2019-05-29T07:38:06.000Z | test/test_functions.py | d9w/pyCGP | 8f23bda9d653b9def91e108e7fdad61c029178e1 | [
"MIT"
] | null | null | null | test/test_functions.py | d9w/pyCGP | 8f23bda9d653b9def91e108e7fdad61c029178e1 | [
"MIT"
] | 3 | 2019-09-15T20:09:17.000Z | 2020-04-10T16:37:29.000Z | from pycgp import CGP
from pycgp.cgpfunctions import *
import numpy as np
def rand_arg():
return np.random.rand() * 2.0 - 1
def build_func_lib():
return [CGP.CGPFunc(f_sum, 'sum', 2),
CGP.CGPFunc(f_aminus, 'aminus', 2),
CGP.CGPFunc(f_mult, 'mult', 2),
CGP.CGPFunc(f_exp, 'ex... | 33.186047 | 55 | 0.508059 | from pycgp import CGP
from pycgp.cgpfunctions import *
import numpy as np
def rand_arg():
return np.random.rand() * 2.0 - 1
def build_func_lib():
return [CGP.CGPFunc(f_sum, 'sum', 2),
CGP.CGPFunc(f_aminus, 'aminus', 2),
CGP.CGPFunc(f_mult, 'mult', 2),
CGP.CGPFunc(f_exp, 'ex... | true | true |
1c0c980f65f777383d824670219385b5588a9d11 | 8,543 | py | Python | snap_scripts/downscaling_10min/prep_raw_nwt_cmip5.py | ua-snap/downscale | 3fe8ea1774cf82149d19561ce5f19b25e6cba6fb | [
"MIT"
] | 5 | 2020-06-24T21:55:12.000Z | 2022-03-23T16:32:54.000Z | snap_scripts/downscaling_10min/prep_raw_nwt_cmip5.py | ua-snap/downscale | 3fe8ea1774cf82149d19561ce5f19b25e6cba6fb | [
"MIT"
] | 17 | 2016-01-04T23:37:47.000Z | 2017-04-17T20:57:02.000Z | snap_scripts/downscaling_10min/prep_raw_nwt_cmip5.py | ua-snap/downscale | 3fe8ea1774cf82149d19561ce5f19b25e6cba6fb | [
"MIT"
] | 3 | 2020-09-16T04:48:57.000Z | 2021-05-25T03:46:00.000Z | # PREPROCESS THE RAW CMIP5 OUTPUTS FROM ESGF INTO PREPPED NetCDF4 files for use in downscaling
# -- Built for the Northwest Territories (NWT) far-futures modeling project.
# Not a replacement for the standard preprocessor, just something to overcome the datetime issues
# in xarray/pandas where we cant deal with times >... | 44.963158 | 162 | 0.619103 |
import pandas as pd
import os
class Files( object ):
def __init__( self, base_dir, *args, **kwargs ):
self.base_dir = base_dir
self.files = self.list_files( )
self.df = self._to_dataframe( )
def list_files( self ):
return [ os.path.join( root, fn ) for root, subs, files in os.... | true | true |
1c0c9a5a9a8a7a7bd22526e6dc1d41352c43404f | 7,317 | py | Python | _unittest/test_Materials.py | sparfenyuk/PyAEDT | efe8d219be974fa8a164d84ca9bc5c0e1b32256c | [
"MIT"
] | null | null | null | _unittest/test_Materials.py | sparfenyuk/PyAEDT | efe8d219be974fa8a164d84ca9bc5c0e1b32256c | [
"MIT"
] | null | null | null | _unittest/test_Materials.py | sparfenyuk/PyAEDT | efe8d219be974fa8a164d84ca9bc5c0e1b32256c | [
"MIT"
] | null | null | null | # standard imports
import os
import gc
try:
import pytest
except ImportError:
import _unittest_ironpython.conf_unittest as pytest
# Setup paths for module imports
from _unittest.conftest import local_path, scratch_path, desktop_version, new_thread, non_graphical
# Import required modules
from pyaedt import Hf... | 62.008475 | 150 | 0.771901 | import os
import gc
try:
import pytest
except ImportError:
import _unittest_ironpython.conf_unittest as pytest
from _unittest.conftest import local_path, scratch_path, desktop_version, new_thread, non_graphical
from pyaedt import Hfss, Icepak
from pyaedt.generic.filesystem import Scratch
from pyaedt.modules.... | true | true |
1c0c9a7a849705fd6383e13e6be51e9c765351a0 | 8,442 | py | Python | bot/cogs/clean.py | Ayplow/bot | 71a3ac9382851845dcb26609d64299bd69b0f0f5 | [
"MIT"
] | null | null | null | bot/cogs/clean.py | Ayplow/bot | 71a3ac9382851845dcb26609d64299bd69b0f0f5 | [
"MIT"
] | null | null | null | bot/cogs/clean.py | Ayplow/bot | 71a3ac9382851845dcb26609d64299bd69b0f0f5 | [
"MIT"
] | null | null | null | import logging
import random
import re
from typing import Optional
from discord import Colour, Embed, Message, User
from discord.ext.commands import Bot, Cog, Context, group
from bot.cogs.modlog import ModLog
from bot.constants import (
Channels, CleanMessages, Colours, Event,
Icons, MODERATION_ROLES, NEGATIV... | 38.903226 | 119 | 0.617982 | import logging
import random
import re
from typing import Optional
from discord import Colour, Embed, Message, User
from discord.ext.commands import Bot, Cog, Context, group
from bot.cogs.modlog import ModLog
from bot.constants import (
Channels, CleanMessages, Colours, Event,
Icons, MODERATION_ROLES, NEGATIV... | true | true |
1c0c9b571f1694560f396388e566567c146737af | 17,136 | py | Python | lingvo/core/hyperparams.py | kristofgiber/lingvo | 18ecb6143921b2786c4eab63cc6012b217bdb408 | [
"Apache-2.0"
] | 1 | 2019-07-11T10:14:30.000Z | 2019-07-11T10:14:30.000Z | lingvo/core/hyperparams.py | CelineQiQi/lingvo | 4c6405a3c8b29764918dbfb599212dd7620ccf9c | [
"Apache-2.0"
] | null | null | null | lingvo/core/hyperparams.py | CelineQiQi/lingvo | 4c6405a3c8b29764918dbfb599212dd7620ccf9c | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 33.338521 | 106 | 0.641165 |
from __future__ import absolute_import
from __future__ import print_function
import ast
import copy
import inspect
import re
import sys
import lingvo.compat as tf
import six
def _QuoteString(s):
single_quote_count = s.count('\'')
double_quote_count = s.count('"')
quote_delim = '\'' if single_quote_count <= d... | true | true |
1c0c9c9045285ae9619ce20f49137f87b0d806ee | 12,739 | py | Python | recipes/CommonVoice/ASR/seq2seq/train.py | anonymspeechbrain/speechbrain | 9a0632ddb066f5bceffb71fb971552fb542f7b7e | [
"Apache-2.0"
] | null | null | null | recipes/CommonVoice/ASR/seq2seq/train.py | anonymspeechbrain/speechbrain | 9a0632ddb066f5bceffb71fb971552fb542f7b7e | [
"Apache-2.0"
] | null | null | null | recipes/CommonVoice/ASR/seq2seq/train.py | anonymspeechbrain/speechbrain | 9a0632ddb066f5bceffb71fb971552fb542f7b7e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
import torch
import logging
import speechbrain as sb
import torchaudio
from hyperpyyaml import load_hyperpyyaml
from speechbrain.tokenizers.SentencePiece import SentencePiece
from speechbrain.utils.data_utils import undo_padding
from speechbrain.utils.distributed import run_on_main
""... | 36.924638 | 89 | 0.653976 | import sys
import torch
import logging
import speechbrain as sb
import torchaudio
from hyperpyyaml import load_hyperpyyaml
from speechbrain.tokenizers.SentencePiece import SentencePiece
from speechbrain.utils.data_utils import undo_padding
from speechbrain.utils.distributed import run_on_main
logger = logging.getLogg... | true | true |
1c0c9caea88962272a1b678b1e8258419e147021 | 4,605 | py | Python | src/examples/phonemic.py | averagehat/vimoir | 356567d075c0ee228150d6108210ac424a8d8f58 | [
"Apache-2.0"
] | null | null | null | src/examples/phonemic.py | averagehat/vimoir | 356567d075c0ee228150d6108210ac424a8d8f58 | [
"Apache-2.0"
] | null | null | null | src/examples/phonemic.py | averagehat/vimoir | 356567d075c0ee228150d6108210ac424a8d8f58 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 Xavier de Gaye
#
# 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... | 34.111111 | 79 | 0.575896 |
import sys
import os
from logging import error, info, debug
def get_speech():
"""Return None when run by python or phonemic.jar cannot be found."""
try:
import java
except ImportError:
return None
try:
sys.path.extend(sys.argv[-1:])
import org.sodbeans.phonemic.TextToS... | false | true |
1c0c9f143c4864e22a1c044c27eb411dec96384d | 9,144 | py | Python | server/app.py | tmm/cs542 | c74d99f9dc665b25b6e1bbe188cd2eb588c7286f | [
"MIT"
] | 4 | 2017-05-03T01:33:21.000Z | 2020-02-14T09:03:02.000Z | server/app.py | tmm/cs542 | c74d99f9dc665b25b6e1bbe188cd2eb588c7286f | [
"MIT"
] | null | null | null | server/app.py | tmm/cs542 | c74d99f9dc665b25b6e1bbe188cd2eb588c7286f | [
"MIT"
] | 3 | 2016-10-11T00:35:40.000Z | 2016-12-15T01:27:22.000Z | import json
import os
import time
from flask import Flask, Response, request, render_template, jsonify, json
from models import db
from JSONEncoder import *
app = Flask(__name__, static_url_path='', static_folder='static')
app.add_url_rule('/', 'root', lambda: app.send_static_file('index.html'))
app.config.from_object... | 26.125714 | 74 | 0.692257 | import json
import os
import time
from flask import Flask, Response, request, render_template, jsonify, json
from models import db
from JSONEncoder import *
app = Flask(__name__, static_url_path='', static_folder='static')
app.add_url_rule('/', 'root', lambda: app.send_static_file('index.html'))
app.config.from_object... | true | true |
1c0c9f4d35ab828573d0082fcd4bcc4424cda133 | 13,410 | py | Python | tests/st/ops/graph_kernel/custom/test_custom_akg.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | 1 | 2022-03-05T02:59:21.000Z | 2022-03-05T02:59:21.000Z | tests/st/ops/graph_kernel/custom/test_custom_akg.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | tests/st/ops/graph_kernel/custom/test_custom_akg.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 34.561856 | 116 | 0.677032 |
import pytest
import numpy as np
from mindspore import context, Tensor
from mindspore.nn import Cell
import mindspore.ops as ops
from mindspore.ops import DataType, CustomRegOp, custom_info_register
def outer_product(a, b):
c = output_tensor(a.shape, a.dtype)
for i0 in range(a.shape[0]):
for i1 in r... | true | true |
1c0c9f615b285581d5a003dc2af81d0294c380d8 | 504 | py | Python | nomadgram/notifications/migrations/0003_auto_20180806_2103.py | juyoungpark718/juyoungram | 24182afb4d3076ba9a8614846368781883f255fa | [
"MIT"
] | null | null | null | nomadgram/notifications/migrations/0003_auto_20180806_2103.py | juyoungpark718/juyoungram | 24182afb4d3076ba9a8614846368781883f255fa | [
"MIT"
] | 12 | 2021-03-02T01:12:10.000Z | 2022-03-03T23:07:52.000Z | nomadgram/notifications/migrations/0003_auto_20180806_2103.py | juyoungpark718/juyoungram | 24182afb4d3076ba9a8614846368781883f255fa | [
"MIT"
] | null | null | null | # Generated by Django 2.0.7 on 2018-08-06 12:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('notifications', '0002_auto_20180806_2101'),
]
operations = [
migrations.AlterField(
model_name=... | 25.2 | 123 | 0.650794 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('notifications', '0002_auto_20180806_2101'),
]
operations = [
migrations.AlterField(
model_name='notifications',
name='image',
... | true | true |
1c0c9f8cc3ed6750d21ba43985fb142dc527cf00 | 6,146 | py | Python | PaddleRec/ssr/train.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 4 | 2020-01-04T13:15:02.000Z | 2021-07-21T07:50:02.000Z | PaddleRec/ssr/train.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 2 | 2019-06-26T03:21:49.000Z | 2019-09-19T09:43:42.000Z | PaddleRec/ssr/train.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 3 | 2019-10-31T07:18:49.000Z | 2020-01-13T03:18:39.000Z | #Copyright (c) 2016 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 applica... | 36.366864 | 77 | 0.630166 | import os
import sys
import time
import argparse
import logging
import paddle.fluid as fluid
import paddle
import utils
import numpy as np
from nets import SequenceSemanticRetrieval
logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s")
logger = logging.getLogger("fluid")
logger.setLevel(logging.INFO)... | true | true |
1c0c9fc3cf624e2c2c8fbdb361c02bb404c32dad | 915 | py | Python | DeepBach/data_utils.py | andreasjansson/DeepBach | 588e1965772856b98d0816518c1c6c71fc30b317 | [
"MIT"
] | 357 | 2017-02-02T22:14:57.000Z | 2022-03-31T14:33:36.000Z | DeepBach/data_utils.py | andreasjansson/DeepBach | 588e1965772856b98d0816518c1c6c71fc30b317 | [
"MIT"
] | 61 | 2017-03-14T21:29:02.000Z | 2021-09-26T16:24:33.000Z | DeepBach/data_utils.py | andreasjansson/DeepBach | 588e1965772856b98d0816518c1c6c71fc30b317 | [
"MIT"
] | 99 | 2017-02-13T15:27:26.000Z | 2022-03-16T23:25:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: Gaetan Hadjeres
"""
import torch
from DeepBach.helpers import cuda_variable
def mask_entry(tensor, entry_index, dim):
"""
Masks entry entry_index on dim dim
similar to
torch.cat(( tensor[ :entry_index], tensor[ entry_index + 1 :], 0)
but ... | 23.461538 | 70 | 0.624044 |
import torch
from DeepBach.helpers import cuda_variable
def mask_entry(tensor, entry_index, dim):
idx = [i for i in range(tensor.size(dim)) if not i == entry_index]
idx = cuda_variable(torch.LongTensor(idx))
tensor = tensor.index_select(dim, idx)
return tensor
def reverse_tensor(tensor, dim):
i... | true | true |
1c0c9fceb29766d69ee10c6105c726a98b76375b | 2,774 | py | Python | SimpleMnistClassifier/MNISTclassifier.py | PravyAI/DeepLearning | 2f6c32f526e649139b1762f3700db20c0d9bd83a | [
"Apache-2.0"
] | null | null | null | SimpleMnistClassifier/MNISTclassifier.py | PravyAI/DeepLearning | 2f6c32f526e649139b1762f3700db20c0d9bd83a | [
"Apache-2.0"
] | null | null | null | SimpleMnistClassifier/MNISTclassifier.py | PravyAI/DeepLearning | 2f6c32f526e649139b1762f3700db20c0d9bd83a | [
"Apache-2.0"
] | null | null | null |
# coding: utf-8
# In[1]:
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | 32.255814 | 89 | 0.688536 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
FLAGS = None
def main(_):
mnist = input_data.read_data_sets(FLAGS.data_dir, one_hot=Tr... | true | true |
1c0ca0097370648ef411bad876c069b2796c7dc2 | 3,689 | py | Python | find_best_model.py | Stelath/geoguessr-ai | 08f5ae7ca8d1e50d586ee66222814589f4095a6d | [
"MIT"
] | null | null | null | find_best_model.py | Stelath/geoguessr-ai | 08f5ae7ca8d1e50d586ee66222814589f4095a6d | [
"MIT"
] | null | null | null | find_best_model.py | Stelath/geoguessr-ai | 08f5ae7ca8d1e50d586ee66222814589f4095a6d | [
"MIT"
] | null | null | null | import os
import argparse
from tqdm import tqdm
import numpy as np
from datetime import datetime
import torch
import torch.nn as nn
import torch.utils.data
import torchvision.models as models
from geoguessr_dataset import GeoGuessrDataset
model_names = sorted(name for name in models.__dict__
if name.islower() and... | 33.536364 | 98 | 0.622662 | import os
import argparse
from tqdm import tqdm
import numpy as np
from datetime import datetime
import torch
import torch.nn as nn
import torch.utils.data
import torchvision.models as models
from geoguessr_dataset import GeoGuessrDataset
model_names = sorted(name for name in models.__dict__
if name.islower() and... | true | true |
1c0ca017cebc9c050f4221ae22fc2a079485c753 | 40,327 | py | Python | tests/storages_tests/test_storages.py | jeffzi/optuna | 133e9d678723ad9e5183789f9271b7f96db32322 | [
"MIT"
] | null | null | null | tests/storages_tests/test_storages.py | jeffzi/optuna | 133e9d678723ad9e5183789f9271b7f96db32322 | [
"MIT"
] | null | null | null | tests/storages_tests/test_storages.py | jeffzi/optuna | 133e9d678723ad9e5183789f9271b7f96db32322 | [
"MIT"
] | null | null | null | import copy
from datetime import datetime
import random
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from unittest.mock import patch
import pytest
import optuna
from optuna._study_direction import StudyDirection
from optuna._study_summary ... | 40.941117 | 99 | 0.676296 | import copy
from datetime import datetime
import random
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from unittest.mock import patch
import pytest
import optuna
from optuna._study_direction import StudyDirection
from optuna._study_summary ... | true | true |
1c0ca07ac914f96ffde67795ed9af77c6c0d8903 | 1,485 | py | Python | tests/test_client.py | larmoreg/fastmicro | 0ddd7ff814357196191612890102ce3bfed79580 | [
"MIT"
] | 1 | 2021-09-03T01:26:11.000Z | 2021-09-03T01:26:11.000Z | tests/test_client.py | larmoreg/fastmicro | 0ddd7ff814357196191612890102ce3bfed79580 | [
"MIT"
] | 9 | 2021-09-07T19:33:09.000Z | 2021-09-25T06:03:00.000Z | tests/test_client.py | larmoreg/fastmicro | 0ddd7ff814357196191612890102ce3bfed79580 | [
"MIT"
] | null | null | null | import asyncio
import logging
import pytest
from fastmicro.entrypoint import Entrypoint
from .conftest import User, Greeting
@pytest.mark.asyncio
async def test_await(_entrypoint: Entrypoint[User, Greeting]) -> None:
input_message = User(name="Greg")
output_message = await _entrypoint(input_message)
a... | 27.5 | 76 | 0.746128 | import asyncio
import logging
import pytest
from fastmicro.entrypoint import Entrypoint
from .conftest import User, Greeting
@pytest.mark.asyncio
async def test_await(_entrypoint: Entrypoint[User, Greeting]) -> None:
input_message = User(name="Greg")
output_message = await _entrypoint(input_message)
a... | true | true |
1c0ca16b1af202463bd6be9737756e102725ab4f | 354 | py | Python | python/testData/hierarchy/call/Static/Super/main.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/hierarchy/call/Static/Super/main.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/hierarchy/call/Static/Super/main.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | class SomeBaseClass(object):
def a_method(self):
pass
class SubclassOne(SomeBaseClass):
def a_method(self):
super(SubclassOne, self).a_method()
class SubclassTwo(SomeBaseClass):
def a_method(self):
super(SubclassTwo, self).a_method()
def that_function():
obj = SubclassTwo()... | 18.631579 | 43 | 0.675141 | class SomeBaseClass(object):
def a_method(self):
pass
class SubclassOne(SomeBaseClass):
def a_method(self):
super(SubclassOne, self).a_method()
class SubclassTwo(SomeBaseClass):
def a_method(self):
super(SubclassTwo, self).a_method()
def that_function():
obj = SubclassTwo()... | true | true |
1c0ca170e97a0b03dce633a620eb041c879390bf | 720 | py | Python | common/urls.py | todorpetkov11/riddance_ecom | 79dc1a566f32a696122d99eac23a100cac22e558 | [
"MIT"
] | null | null | null | common/urls.py | todorpetkov11/riddance_ecom | 79dc1a566f32a696122d99eac23a100cac22e558 | [
"MIT"
] | null | null | null | common/urls.py | todorpetkov11/riddance_ecom | 79dc1a566f32a696122d99eac23a100cac22e558 | [
"MIT"
] | null | null | null | from django.urls import path
from common.views import browse_category, LandingView, BrowseView, checkout, orders_details, accept_order, \
dismiss_order, SearchResultsView
urlpatterns = [
path('', BrowseView.as_view(), name='browse'),
path('about_us/', LandingView.as_view(), name='landing'),
pa... | 42.352941 | 109 | 0.694444 | from django.urls import path
from common.views import browse_category, LandingView, BrowseView, checkout, orders_details, accept_order, \
dismiss_order, SearchResultsView
urlpatterns = [
path('', BrowseView.as_view(), name='browse'),
path('about_us/', LandingView.as_view(), name='landing'),
pa... | true | true |
1c0ca2a0829ed16045733111552ab90546d53ac5 | 1,670 | py | Python | apigateway/apps/store_profile_handle.py | cnds/wxdemo | a445ea19ccd0b47caf6ea94e1ddec2ce3faf7d5e | [
"MIT"
] | null | null | null | apigateway/apps/store_profile_handle.py | cnds/wxdemo | a445ea19ccd0b47caf6ea94e1ddec2ce3faf7d5e | [
"MIT"
] | null | null | null | apigateway/apps/store_profile_handle.py | cnds/wxdemo | a445ea19ccd0b47caf6ea94e1ddec2ce3faf7d5e | [
"MIT"
] | null | null | null | # deprecated
import requests
from flask import request, jsonify
from .base import BaseHandler
from .json_validate import SCHEMA
from jybase.utils import create_md5_key
from config import config
class StoreProfileHandler(BaseHandler):
def get(self, store_id):
flag, tag = self.authenticate(request, store_i... | 34.081633 | 73 | 0.608982 | import requests
from flask import request, jsonify
from .base import BaseHandler
from .json_validate import SCHEMA
from jybase.utils import create_md5_key
from config import config
class StoreProfileHandler(BaseHandler):
def get(self, store_id):
flag, tag = self.authenticate(request, store_id,
... | true | true |
1c0ca36ac0cfbdc0fd453a71a56895af4700c9ae | 9,862 | py | Python | hunabku/plugins/DocumentsApp.py | cesarari/HunabKu | 84358f2b93e8937403ab9d421b6dec434d5fcbae | [
"BSD-3-Clause"
] | null | null | null | hunabku/plugins/DocumentsApp.py | cesarari/HunabKu | 84358f2b93e8937403ab9d421b6dec434d5fcbae | [
"BSD-3-Clause"
] | null | null | null | hunabku/plugins/DocumentsApp.py | cesarari/HunabKu | 84358f2b93e8937403ab9d421b6dec434d5fcbae | [
"BSD-3-Clause"
] | null | null | null | from hunabku.HunabkuBase import HunabkuPluginBase, endpoint
from bson import ObjectId
from pymongo import ASCENDING,DESCENDING
from pickle import load
class DocumentsApp(HunabkuPluginBase):
def __init__(self, hunabku):
super().__init__(hunabku)
def get_info(self,idx):
document = self.colav_db[... | 46.300469 | 1,599 | 0.509633 | from hunabku.HunabkuBase import HunabkuPluginBase, endpoint
from bson import ObjectId
from pymongo import ASCENDING,DESCENDING
from pickle import load
class DocumentsApp(HunabkuPluginBase):
def __init__(self, hunabku):
super().__init__(hunabku)
def get_info(self,idx):
document = self.colav_db[... | true | true |
1c0ca3f8ce4f5fa85e3de567591d2c1f3db0ca4f | 19,049 | py | Python | create_derivatives/routines.py | RockefellerArchiveCenter/pictor | 244b1a2016664974f38885d0ab2e6ac472306a85 | [
"MIT"
] | null | null | null | create_derivatives/routines.py | RockefellerArchiveCenter/pictor | 244b1a2016664974f38885d0ab2e6ac472306a85 | [
"MIT"
] | 88 | 2021-07-21T15:14:40.000Z | 2022-03-10T20:11:40.000Z | create_derivatives/routines.py | RockefellerArchiveCenter/pictor | 244b1a2016664974f38885d0ab2e6ac472306a85 | [
"MIT"
] | null | null | null | import json
import math
import subprocess
from pathlib import Path
from shutil import rmtree
import bagit
import shortuuid
from asterism.file_helpers import anon_extract_all
from iiif_prezi.factory import ManifestFactory
from iiif_prezi_upgrader import Upgrader
from pictor import settings
from PIL import Image
from .... | 39.768267 | 130 | 0.639351 | import json
import math
import subprocess
from pathlib import Path
from shutil import rmtree
import bagit
import shortuuid
from asterism.file_helpers import anon_extract_all
from iiif_prezi.factory import ManifestFactory
from iiif_prezi_upgrader import Upgrader
from pictor import settings
from PIL import Image
from .... | true | true |
1c0ca630cc8fdc807e7796f9de32597df6812331 | 1,544 | py | Python | integration/dagster/setup.py | skcc00000app08542/OpenLineage | e0dd3715e61b3d89f60ece0d7385e82ccd141ba4 | [
"Apache-2.0"
] | 1 | 2022-01-06T03:45:24.000Z | 2022-01-06T03:45:24.000Z | integration/dagster/setup.py | skcc00000app08542/OpenLineage | e0dd3715e61b3d89f60ece0d7385e82ccd141ba4 | [
"Apache-2.0"
] | null | null | null | integration/dagster/setup.py | skcc00000app08542/OpenLineage | e0dd3715e61b3d89f60ece0d7385e82ccd141ba4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# 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, softwar... | 26.62069 | 74 | 0.705311 | from setuptools import setup, find_namespace_packages
with open("README.md") as readme_file:
readme = readme_file.read()
__version__ = "0.7.0"
DAGSTER_VERSION = "0.13.8"
requirements = [
"attrs>=19.3",
"cattrs",
f"dagster>={DAGSTER_VERSION}",
f"openlineage-python=={__version__}",
]
extras_requi... | true | true |
1c0ca6eb3666bcc744aa7aa4979f7f43770525ad | 2,747 | py | Python | lib/python3.7/site-packages/dash_bootstrap_components/_components/Collapse.py | dukuaris/Django | d34f3e3f09028511e96b99cae7faa1b46458eed1 | [
"MIT"
] | null | null | null | lib/python3.7/site-packages/dash_bootstrap_components/_components/Collapse.py | dukuaris/Django | d34f3e3f09028511e96b99cae7faa1b46458eed1 | [
"MIT"
] | 12 | 2020-06-06T01:22:26.000Z | 2022-03-12T00:13:42.000Z | lib/python3.7/site-packages/dash_bootstrap_components/_components/Collapse.py | dukuaris/Django | d34f3e3f09028511e96b99cae7faa1b46458eed1 | [
"MIT"
] | null | null | null | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Collapse(Component):
"""A Collapse component.
Keyword arguments:
- children (a list of or a singular dash component, string or number; optional): The children of this component.
- id (string; opti... | 58.446809 | 272 | 0.716782 |
from dash.development.base_component import Component, _explicitize_args
class Collapse(Component):
@_explicitize_args
def __init__(self, children=None, id=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, key=Component.UNDEFINED, tag=Component.UNDEFINED, is_open=Component.UNDEFI... | true | true |
1c0ca703db91b44d4f4eaff41b9b4aa83b8e3966 | 1,880 | py | Python | ibis/file/hdf5.py | hjoo/ibis | 72ece317337fb7d329337f20db930845a669ce85 | [
"Apache-2.0"
] | 5 | 2018-04-26T17:42:14.000Z | 2020-10-14T19:02:59.000Z | ibis/file/hdf5.py | hjoo/ibis | 72ece317337fb7d329337f20db930845a669ce85 | [
"Apache-2.0"
] | 12 | 2018-04-07T03:13:34.000Z | 2020-07-13T15:45:34.000Z | ibis/file/hdf5.py | ian-r-rose/ibis | c2323b8dfd7b56db821426513c379de38203b332 | [
"Apache-2.0"
] | 1 | 2020-04-12T19:51:50.000Z | 2020-04-12T19:51:50.000Z | import pandas as pd
import ibis.expr.operations as ops
import ibis.expr.schema as sch
from ibis.file.client import FileClient
from ibis.pandas.core import execute, execute_node
def connect(path):
"""Create a HDF5Client for use with Ibis
Parameters
----------
path: str or pathlib.Path
Returns
... | 24.102564 | 78 | 0.612234 | import pandas as pd
import ibis.expr.operations as ops
import ibis.expr.schema as sch
from ibis.file.client import FileClient
from ibis.pandas.core import execute, execute_node
def connect(path):
return HDFClient(path)
class HDFTable(ops.DatabaseTable):
pass
class HDFClient(FileClient):
extension = '... | true | true |
1c0ca7393fdc1049a692d4f06b48f4b27706f3fe | 24,563 | py | Python | rfho/models.py | lucfra/RFHO | e08a36fcc342a46648c5e9d7f64a69cb3d3c6c79 | [
"MIT"
] | 53 | 2017-04-23T10:24:14.000Z | 2021-12-21T09:49:12.000Z | rfho/models.py | lucfra/RFHO | e08a36fcc342a46648c5e9d7f64a69cb3d3c6c79 | [
"MIT"
] | 2 | 2018-06-04T21:59:09.000Z | 2019-01-04T07:37:35.000Z | rfho/models.py | lucfra/RFHO | e08a36fcc342a46648c5e9d7f64a69cb3d3c6c79 | [
"MIT"
] | 10 | 2017-05-02T12:57:27.000Z | 2021-02-26T01:44:17.000Z | # import data
# import numpy as np
# working with placeholders
from functools import reduce
import tensorflow as tf
from rfho.utils import MergedVariable
import tensorflow.contrib.graph_editor as ge
import rfho.utils as utils
test = False
do_print = False
def calc_mb(_shape, _type=32):
from functools import red... | 40.201309 | 120 | 0.621504 | from functools import reduce
import tensorflow as tf
from rfho.utils import MergedVariable
import tensorflow.contrib.graph_editor as ge
import rfho.utils as utils
test = False
do_print = False
def calc_mb(_shape, _type=32):
from functools import reduce
import operator
return 1. * reduce(operator.mul, _s... | true | true |
1c0ca75c12ceb6049c307cbfc4586d4071486151 | 3,806 | py | Python | colour/algebra/common.py | jchwei/colour | 2b2ad0a0f2052a1a0b4b076b489687235e804fdf | [
"BSD-3-Clause"
] | 2 | 2020-06-20T03:44:41.000Z | 2020-06-20T14:08:41.000Z | colour/algebra/common.py | enneract/colour | 27470c16f7a5bf388d0f0798884e8b7abdceafa4 | [
"BSD-3-Clause"
] | null | null | null | colour/algebra/common.py | enneract/colour | 27470c16f7a5bf388d0f0798884e8b7abdceafa4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Common Utilities
================
Defines common algebra utilities objects that don't fall in any specific
category:
- :func:`colour.algebra.spow`: Safe (symmetrical) power.
"""
from __future__ import division, unicode_literals
import functools
import numpy as np
from colour.utilities... | 22.25731 | 79 | 0.615607 |
from __future__ import division, unicode_literals
import functools
import numpy as np
from colour.utilities import as_float_array, as_float
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2020 - Colour Developers'
__license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause'
__... | true | true |
1c0ca7bd18b26e3c61f6139d4bd273204d75e6b5 | 8,688 | py | Python | open_seq2seq/decoders/fc_decoders.py | karakusc/OpenSeq2Seq | 87e9625af99b799808d5d9af8147f8ee4a2c5dbe | [
"MIT"
] | 5 | 2019-05-30T16:46:42.000Z | 2021-02-18T07:49:44.000Z | open_seq2seq/decoders/fc_decoders.py | karakusc/OpenSeq2Seq | 87e9625af99b799808d5d9af8147f8ee4a2c5dbe | [
"MIT"
] | null | null | null | open_seq2seq/decoders/fc_decoders.py | karakusc/OpenSeq2Seq | 87e9625af99b799808d5d9af8147f8ee4a2c5dbe | [
"MIT"
] | 3 | 2020-01-13T22:41:22.000Z | 2021-07-12T08:41:34.000Z | # Copyright (c) 2018 NVIDIA Corporation
"""This module defines various fully-connected decoders (consisting of one
fully connected layer).
These classes are usually used for models that are not really
sequence-to-sequence and thus should be artificially split into encoder and
decoder by cutting, for example, on the la... | 35.174089 | 86 | 0.647675 | from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import os
import tensorflow as tf
from .decoder import Decoder
class FullyConnectedDecoder(Decoder):
@staticmethod
def get_required_params():
return dict(Decoder.get_required_params(), **{
'outp... | true | true |
1c0ca93f51ff58793f397606de09ff6e0e7650a8 | 2,589 | py | Python | examples/objects/Python/book.py | davidli3100/ICS4U | b12f3ee88b475b5da1866bef179da4e9ff7bd2d2 | [
"MIT"
] | null | null | null | examples/objects/Python/book.py | davidli3100/ICS4U | b12f3ee88b475b5da1866bef179da4e9ff7bd2d2 | [
"MIT"
] | null | null | null | examples/objects/Python/book.py | davidli3100/ICS4U | b12f3ee88b475b5da1866bef179da4e9ff7bd2d2 | [
"MIT"
] | null | null | null | class Book():
'''
A book object that hold the price, author, and title of book
Attributes
----------
price : float
The price of the book in dollars and cents (example format ###.##)
author : str
The full name of the author of the book
title : str
The full title of the book
Methods
-------
# note, d... | 20.879032 | 80 | 0.65083 | class Book():
def __init__(self, author, title, price=0.00):
self.author = author
self.price = price
self.title = title
def getAuthor(self) -> str:
return self.author
def getPrice(self) -> float:
return float(self.price)
def getTitle(self) -> str:
return self.title
def increase... | true | true |
1c0ca96c148406cd51c09a8cd7857b9a36dba5c4 | 6,921 | py | Python | test/functional/feature_maxuploadtarget.py | danhper/bitcoin-abc | d2b4bfc4d42d054cfebb5d951d23bbe96115f262 | [
"MIT"
] | 1 | 2021-09-08T14:26:46.000Z | 2021-09-08T14:26:46.000Z | test/functional/feature_maxuploadtarget.py | danhper/bitcoin-abc | d2b4bfc4d42d054cfebb5d951d23bbe96115f262 | [
"MIT"
] | 1 | 2020-02-19T10:28:45.000Z | 2020-02-19T10:28:45.000Z | test/functional/feature_maxuploadtarget.py | danhper/bitcoin-abc | d2b4bfc4d42d054cfebb5d951d23bbe96115f262 | [
"MIT"
] | 1 | 2017-06-30T20:58:07.000Z | 2017-06-30T20:58:07.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test behavior of -maxuploadtarget.
* Verify that getdata requests for old blocks (>1week) are dropped
... | 38.882022 | 84 | 0.668834 |
from collections import defaultdict
import time
from test_framework.cdefs import LEGACY_MAX_BLOCK_SIZE
from test_framework.blocktools import mine_big_block
from test_framework.messages import CInv, msg_getdata
from test_framework.mininode import P2PInterface
from test_framework.test_framework import BitcoinTestFramew... | true | true |
1c0caa65043fce08a102f203bf74ea7ed2a75f65 | 2,555 | py | Python | scripts/server/socket_handler.py | Jothin-kumar/chat-app | b170bd72574473c040d0571e19f4b3552a5c2aaa | [
"MIT"
] | 2 | 2021-11-26T12:52:40.000Z | 2021-12-10T13:33:11.000Z | scripts/server/socket_handler.py | Jothin-kumar/chat-app | b170bd72574473c040d0571e19f4b3552a5c2aaa | [
"MIT"
] | null | null | null | scripts/server/socket_handler.py | Jothin-kumar/chat-app | b170bd72574473c040d0571e19f4b3552a5c2aaa | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2021 B.Jothin kumar
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 rights
to use, copy, modify, merge, publish... | 31.54321 | 78 | 0.679452 | import socket
import time
import threading
import message_parser
s = socket.socket()
port = 1265
s.bind(('', port))
s.listen(5)
clients = []
def on_new_message(msg, sender):
channel, message = message_parser.decode_message(msg)
for client in clients:
if client != sender:
client.send(messa... | true | true |
1c0caaff27c6dc5bcd745d77f52b2377aff74a93 | 14,253 | py | Python | devito/finite_differences/derivative.py | ccuetom/devito | 3bd907bed50eff8608e36d83b92c706685a7d275 | [
"MIT"
] | 1 | 2021-05-31T04:56:33.000Z | 2021-05-31T04:56:33.000Z | devito/finite_differences/derivative.py | ccuetom/devito | 3bd907bed50eff8608e36d83b92c706685a7d275 | [
"MIT"
] | null | null | null | devito/finite_differences/derivative.py | ccuetom/devito | 3bd907bed50eff8608e36d83b92c706685a7d275 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from collections.abc import Iterable
from cached_property import cached_property
import sympy
from devito.finite_differences.finite_difference import (generic_derivative,
first_derivative,
... | 38.836512 | 90 | 0.596015 | from collections import OrderedDict
from collections.abc import Iterable
from cached_property import cached_property
import sympy
from devito.finite_differences.finite_difference import (generic_derivative,
first_derivative,
... | true | true |
1c0cab38772794143a0d4ee9b51df309fe00a457 | 15,056 | py | Python | scripts/modelDb/fem/orphanMesh.py | fracturica/policrack | 653167ffb9bd1bc53811bbe8eb050978076713ba | [
"MIT"
] | 1 | 2020-08-12T11:19:09.000Z | 2020-08-12T11:19:09.000Z | scripts/modelDb/fem/orphanMesh.py | fracturica/policrack | 653167ffb9bd1bc53811bbe8eb050978076713ba | [
"MIT"
] | null | null | null | scripts/modelDb/fem/orphanMesh.py | fracturica/policrack | 653167ffb9bd1bc53811bbe8eb050978076713ba | [
"MIT"
] | null | null | null |
import sys
import math
from abaqus import *
from abaqusConstants import *
import part
import material
import section
import assembly
import step
import interaction
import sketch
import regionToolset, displayGroupMdbToolset as dgm, mesh, load, job
import inpReader
import meshEdit
import customKernel
import scripts.... | 32.448276 | 95 | 0.605141 |
import sys
import math
from abaqus import *
from abaqusConstants import *
import part
import material
import section
import assembly
import step
import interaction
import sketch
import regionToolset, displayGroupMdbToolset as dgm, mesh, load, job
import inpReader
import meshEdit
import customKernel
import scripts.... | true | true |
1c0cac569b2844465cadd960ffc515e79194dca9 | 5,628 | py | Python | client/openapi_client/models/client_concept.py | NCATS-Tangerine/kba-reasoner | 19ea293fa02693b2df5ecfe1d91856b34e73a3e1 | [
"MIT"
] | null | null | null | client/openapi_client/models/client_concept.py | NCATS-Tangerine/kba-reasoner | 19ea293fa02693b2df5ecfe1d91856b34e73a3e1 | [
"MIT"
] | null | null | null | client/openapi_client/models/client_concept.py | NCATS-Tangerine/kba-reasoner | 19ea293fa02693b2df5ecfe1d91856b34e73a3e1 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Translator Knowledge Beacon Aggregator API
This is the Translator Knowledge Beacon Aggregator web service application programming interface (API) that provides integrated access to a pool of knowledge sources publishing concepts and relations through the Translator Knowledge Beacon API. Th... | 32.72093 | 570 | 0.613006 |
import pprint
import re
import six
class ClientConcept(object):
openapi_types = {
'clique': 'str',
'name': 'str',
'categories': 'list[str]'
}
attribute_map = {
'clique': 'clique',
'name': 'name',
'categories': 'categories'
}
def __init__(self... | true | true |
1c0cad565ac48d69f1a222b9b866e04ff966ffcd | 357 | py | Python | Semana6/numeroaleatorio.py | BrayanTorres2/Algoritmosyprogramaci-n-Grupo2Ciclo4- | ad64b5a3d3d129efaa297617748a74872522d7a1 | [
"MIT"
] | 4 | 2021-09-27T17:20:56.000Z | 2021-09-28T23:12:49.000Z | Semana6/numeroaleatorio.py | BrayanTorres2/Algoritmosyprogramaci-n-Grupo2Ciclo4- | ad64b5a3d3d129efaa297617748a74872522d7a1 | [
"MIT"
] | null | null | null | Semana6/numeroaleatorio.py | BrayanTorres2/Algoritmosyprogramaci-n-Grupo2Ciclo4- | ad64b5a3d3d129efaa297617748a74872522d7a1 | [
"MIT"
] | 1 | 2021-11-19T02:26:18.000Z | 2021-11-19T02:26:18.000Z | import random
numero=random.randint(0, 10)
print(numero)
c=0
while True:
if(c==3):
print("Demaciados intentos")
break
try:
adivina=int(input("Digite numero: "))
if(adivina==numero):
print("¡¡Ganaste!!")
break
else:
print("Sigue intentando")
c=c+1
except ValueError:
... | 18.789474 | 41 | 0.610644 | import random
numero=random.randint(0, 10)
print(numero)
c=0
while True:
if(c==3):
print("Demaciados intentos")
break
try:
adivina=int(input("Digite numero: "))
if(adivina==numero):
print("¡¡Ganaste!!")
break
else:
print("Sigue intentando")
c=c+1
except ValueError:
... | true | true |
1c0cada17f8a1fef1e3fa042c1f0f1214c816873 | 7,041 | py | Python | src/gamesbyexample/hacking.py | jlmartinnc/PythonStdioGames | 8bdabf93e6b1bb6af3e26fea24da93f85e8314b6 | [
"Python-2.0"
] | 736 | 2018-09-24T10:29:27.000Z | 2022-03-20T21:28:20.000Z | src/gamesbyexample/hacking.py | vshevchenko12/PythonStdioGames | 8bdabf93e6b1bb6af3e26fea24da93f85e8314b6 | [
"Python-2.0"
] | 11 | 2019-03-26T06:55:47.000Z | 2021-03-23T03:00:35.000Z | src/gamesbyexample/hacking.py | vshevchenko12/PythonStdioGames | 8bdabf93e6b1bb6af3e26fea24da93f85e8314b6 | [
"Python-2.0"
] | 205 | 2018-12-07T11:58:13.000Z | 2022-03-26T02:06:58.000Z | """Hacking Minigame, by Al Sweigart al@inventwithpython.com
The hacking mini-game from "Fallout 3". Find out which seven-letter
word is the password by using clues each guess gives you.
This code is available at https://nostarch.com/big-book-small-python-programming
Tags: large, artistic, game, puzzle"""
__version__ = ... | 38.686813 | 80 | 0.647635 | __version__ = 0
import random, sys
GARBAGE_CHARS = '~!@#$%^&*()_+-={}[]|;:,.<>?/'
with open('sevenletterwords.txt') as wordListFile:
WORDS = wordListFile.readlines()
for i in range(len(WORDS)):
WORDS[i] = WORDS[i].strip().upper()
def main():
print('''Hacking Minigame, by Al Sweigart al@inventwithpy... | true | true |
1c0cadfad0a53e417847eeb7cf5c189de496c855 | 643 | py | Python | deco/sources/squeeze.py | mfojtak/decor | 203979351635a6794c91200fca4a14296ec9bc37 | [
"MIT"
] | 1 | 2019-09-05T07:23:19.000Z | 2019-09-05T07:23:19.000Z | deco/sources/squeeze.py | mfojtak/decor | 203979351635a6794c91200fca4a14296ec9bc37 | [
"MIT"
] | 2 | 2020-10-25T17:41:08.000Z | 2020-10-26T16:48:19.000Z | deco/sources/squeeze.py | mfojtak/deco | 203979351635a6794c91200fca4a14296ec9bc37 | [
"MIT"
] | null | null | null | from deco.sources import Dataset
import numpy as np
def squeeze_rec(item):
if isinstance(item, list):
new_list = []
for subitem in item:
new_list.append(squeeze_rec(subitem))
if len(new_list) == 1:
new_list = new_list[0]
return new_list
else:... | 22.964286 | 50 | 0.584759 | from deco.sources import Dataset
import numpy as np
def squeeze_rec(item):
if isinstance(item, list):
new_list = []
for subitem in item:
new_list.append(squeeze_rec(subitem))
if len(new_list) == 1:
new_list = new_list[0]
return new_list
else:... | true | true |
1c0cae05b5477d68198b49ee02725c0aecb1c873 | 3,816 | py | Python | SimpleCoinWallet/wallet.py | surajsinghbisht054/PythonAnywhere-Django-SimpleCoin-Implementation | 80451dea33b6e35332c815df5b6dfa94f1242d43 | [
"Apache-2.0"
] | 2 | 2018-10-31T17:38:29.000Z | 2021-06-08T18:41:01.000Z | SimpleCoinWallet/wallet.py | surajsinghbisht054/PythonAnywhere-Django-SimpleCoin-Implementation | 80451dea33b6e35332c815df5b6dfa94f1242d43 | [
"Apache-2.0"
] | 1 | 2018-06-02T18:17:35.000Z | 2018-06-16T08:13:41.000Z | SimpleCoinWallet/wallet.py | surajsinghbisht054/PythonAnywhere-Django-SimpleCoin-Implementation | 80451dea33b6e35332c815df5b6dfa94f1242d43 | [
"Apache-2.0"
] | 1 | 2018-06-13T02:44:27.000Z | 2018-06-13T02:44:27.000Z | from .SimpleCoinV4 import User as UserWallet, SimpleBlockChain, PleaseMine, RequestTransection
from .models import UserInfo, rtxn, User as UserAdmin, stxn
import pickle
import json
sbc = SimpleBlockChain()
def getchain():
return json.dumps(sbc.chain, sort_keys=True, indent=4, separators=(',', ': '))
def conform... | 25.105263 | 94 | 0.551363 | from .SimpleCoinV4 import User as UserWallet, SimpleBlockChain, PleaseMine, RequestTransection
from .models import UserInfo, rtxn, User as UserAdmin, stxn
import pickle
import json
sbc = SimpleBlockChain()
def getchain():
return json.dumps(sbc.chain, sort_keys=True, indent=4, separators=(',', ': '))
def conform... | false | true |
1c0cb05d07512ea24e5bea9d8b97539d05ee6754 | 4,342 | py | Python | thirdparty/antlr3-antlr-3.5/runtime/Python/tests/t047treeparser.py | mail2nsrajesh/congress | a724dfb59c43a5e88e2b03e714a5f962d6976762 | [
"Apache-2.0"
] | 3,266 | 2017-08-06T16:51:46.000Z | 2022-03-30T07:34:24.000Z | thirdparty/antlr3-antlr-3.5/runtime/Python/tests/t047treeparser.py | mail2nsrajesh/congress | a724dfb59c43a5e88e2b03e714a5f962d6976762 | [
"Apache-2.0"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | thirdparty/antlr3-antlr-3.5/runtime/Python/tests/t047treeparser.py | mail2nsrajesh/congress | a724dfb59c43a5e88e2b03e714a5f962d6976762 | [
"Apache-2.0"
] | 1,449 | 2017-08-06T17:40:59.000Z | 2022-03-31T12:03:24.000Z | import unittest
import textwrap
import antlr3
import antlr3.tree
import testbase
class T(testbase.ANTLRTest):
def walkerClass(self, base):
class TWalker(base):
def __init__(self, *args, **kwargs):
base.__init__(self, *args, **kwargs)
self.traces = []
... | 35.300813 | 241 | 0.506909 | import unittest
import textwrap
import antlr3
import antlr3.tree
import testbase
class T(testbase.ANTLRTest):
def walkerClass(self, base):
class TWalker(base):
def __init__(self, *args, **kwargs):
base.__init__(self, *args, **kwargs)
self.traces = []
... | true | true |
1c0cb05d4664a764850ace595766af7b7a0aae38 | 1,825 | py | Python | tests/postgres_tests/fields.py | Lord-Elrond/django | 178109c1734ccc16386c3e3cbae1465c7a1b8ed8 | [
"BSD-3-Clause",
"0BSD"
] | 61,676 | 2015-01-01T00:05:13.000Z | 2022-03-31T20:37:54.000Z | tests/postgres_tests/fields.py | Lord-Elrond/django | 178109c1734ccc16386c3e3cbae1465c7a1b8ed8 | [
"BSD-3-Clause",
"0BSD"
] | 8,884 | 2015-01-01T00:12:05.000Z | 2022-03-31T19:53:11.000Z | tests/postgres_tests/fields.py | Lord-Elrond/django | 178109c1734ccc16386c3e3cbae1465c7a1b8ed8 | [
"BSD-3-Clause",
"0BSD"
] | 33,143 | 2015-01-01T02:04:52.000Z | 2022-03-31T19:42:46.000Z | """
Indirection layer for PostgreSQL-specific fields, so the tests don't fail when
run with a backend other than PostgreSQL.
"""
import enum
from django.db import models
try:
from django.contrib.postgres.fields import (
ArrayField, BigIntegerRangeField, CICharField, CIEmailField,
CITextField, Date... | 33.181818 | 78 | 0.672877 | import enum
from django.db import models
try:
from django.contrib.postgres.fields import (
ArrayField, BigIntegerRangeField, CICharField, CIEmailField,
CITextField, DateRangeField, DateTimeRangeField, DecimalRangeField,
HStoreField, IntegerRangeField,
)
from django.contrib.postgres... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.