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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2586b08c854339aac2d44b42b0003e4525d8ae | 1,239 | py | Python | tinycord/middleware/stage_instance_create.py | tinycord/tinycord | 9e817452c1f2357878f07f8622f6240687470cad | [
"MIT"
] | 8 | 2022-01-08T20:04:29.000Z | 2022-03-21T19:12:19.000Z | tinycord/middleware/stage_instance_create.py | tinycord/tinycord | 9e817452c1f2357878f07f8622f6240687470cad | [
"MIT"
] | null | null | null | tinycord/middleware/stage_instance_create.py | tinycord/tinycord | 9e817452c1f2357878f07f8622f6240687470cad | [
"MIT"
] | 1 | 2022-01-02T21:42:53.000Z | 2022-01-02T21:42:53.000Z | import typing
if typing.TYPE_CHECKING:
from ..client import Client
from ..core import Gateway, GatewayDispatch
from ..models import StageChannel
async def stage_create(client: "Client", gateway: "Gateway", event: "GatewayDispatch") -> typing.List[typing.Awaitable]:
"""
|coro|
This eve... | 30.219512 | 120 | 0.628733 | import typing
if typing.TYPE_CHECKING:
from ..client import Client
from ..core import Gateway, GatewayDispatch
from ..models import StageChannel
async def stage_create(client: "Client", gateway: "Gateway", event: "GatewayDispatch") -> typing.List[typing.Awaitable]:
stage = StageChannel(client, **even... | true | true |
1c25882cef759e66851cd1ba542c4d11c7334637 | 12,234 | py | Python | SortedCollection.py | linux-genz/genz-spec-extract | 636a7cb40b42d8854b09a3adc5f7cbc382c5371a | [
"MIT"
] | null | null | null | SortedCollection.py | linux-genz/genz-spec-extract | 636a7cb40b42d8854b09a3adc5f7cbc382c5371a | [
"MIT"
] | null | null | null | SortedCollection.py | linux-genz/genz-spec-extract | 636a7cb40b42d8854b09a3adc5f7cbc382c5371a | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, m... | 36.849398 | 103 | 0.585336 |
from bisect import bisect_left, bisect_right
class SortedCollection(object):
def __init__(self, iterable=(), key=None):
self._given_key = key
key = (lambda x: x) if key is None else key
decorated = sorted((key(item), item) for item in iterable)
self._keys = [k f... | true | true |
1c2588eb1251f76d3a20b6deba38694cd4f040a8 | 405 | py | Python | website/wsgi.py | Hogwarts250/lesson-discussion | 42aa0d5d4e4a8cb10c99ff7558e9d7a5f2f3e470 | [
"Apache-2.0"
] | null | null | null | website/wsgi.py | Hogwarts250/lesson-discussion | 42aa0d5d4e4a8cb10c99ff7558e9d7a5f2f3e470 | [
"Apache-2.0"
] | 4 | 2021-04-08T19:49:25.000Z | 2021-06-10T20:08:37.000Z | website/wsgi.py | Hogwarts250/lesson-discussion | 42aa0d5d4e4a8cb10c99ff7558e9d7a5f2f3e470 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for lesson_discussion project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJ... | 23.823529 | 78 | 0.790123 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'website.settings.dev')
application = get_wsgi_application()
| true | true |
1c25892094503f0b5b9428b40dcf1937451e6f17 | 63 | py | Python | __init__.py | ThalesMR/KafkaHandler | 1ccb15d3e85df69e9dbe9e8013d9b7b2792eff59 | [
"MIT"
] | null | null | null | __init__.py | ThalesMR/KafkaHandler | 1ccb15d3e85df69e9dbe9e8013d9b7b2792eff59 | [
"MIT"
] | null | null | null | __init__.py | ThalesMR/KafkaHandler | 1ccb15d3e85df69e9dbe9e8013d9b7b2792eff59 | [
"MIT"
] | null | null | null | from KafkaHandler.KafkaHandler import KafkaHandler
__all__ = [] | 31.5 | 50 | 0.84127 | from KafkaHandler.KafkaHandler import KafkaHandler
__all__ = [] | true | true |
1c258a9e587d7dd682c896fdb3ec97ecff1ddd3d | 1,557 | py | Python | src/sentry/api/endpoints/organization_tagkey_values.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 2 | 2019-03-04T12:45:54.000Z | 2019-03-04T12:45:55.000Z | src/sentry/api/endpoints/organization_tagkey_values.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 196 | 2019-06-10T08:34:10.000Z | 2022-02-22T01:26:13.000Z | src/sentry/api/endpoints/organization_tagkey_values.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 1 | 2017-02-09T06:36:57.000Z | 2017-02-09T06:36:57.000Z | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.bases import OrganizationEventsEndpointBase, OrganizationEventsError, NoProjects
from sentry.api.paginator import SequencePaginator
from sentry.api.serializers import serialize
from sentry.tagstore.base import TAG_KEY_... | 37.071429 | 96 | 0.662813 | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.bases import OrganizationEventsEndpointBase, OrganizationEventsError, NoProjects
from sentry.api.paginator import SequencePaginator
from sentry.api.serializers import serialize
from sentry.tagstore.base import TAG_KEY_... | true | true |
1c258b1eb66b82a0f6382d62437278747bdc41a1 | 381 | py | Python | nabu/neuralnetworks/trainers/trainer_factory.py | Darleen2019/Nabu-MSSS | 5e862cbf846d45b8a317f87588533f3fde9f0726 | [
"MIT"
] | 18 | 2017-10-16T13:12:46.000Z | 2022-02-15T01:20:00.000Z | nabu/neuralnetworks/trainers/trainer_factory.py | Darleen2019/Nabu-MSSS | 5e862cbf846d45b8a317f87588533f3fde9f0726 | [
"MIT"
] | null | null | null | nabu/neuralnetworks/trainers/trainer_factory.py | Darleen2019/Nabu-MSSS | 5e862cbf846d45b8a317f87588533f3fde9f0726 | [
"MIT"
] | 9 | 2017-10-03T18:10:10.000Z | 2020-11-13T08:26:31.000Z | """@file trainer_factory.py
contains the Trainer factory"""
from . import multi_task_trainer
def factory(train_type='single_task'):
"""
gets a trainer class
Args:
train_type: the trainer type
Returns:
a trainer class
"""
if train_type == 'multi_task':
return multi_task_trainer.MultiTaskTrainer
else:
... | 17.318182 | 60 | 0.737533 |
from . import multi_task_trainer
def factory(train_type='single_task'):
if train_type == 'multi_task':
return multi_task_trainer.MultiTaskTrainer
else:
raise Exception('Undefined trainer type: %s' % train_type)
| true | true |
1c258b5199a9cef5a7f4d7999b3898cde6ac6541 | 3,096 | py | Python | src/whylogs/util/data.py | cswarth/whylogs | 6805b252f1d07efde84836d3924949f7ec2d97b1 | [
"Apache-2.0"
] | 603 | 2020-07-31T23:26:10.000Z | 2022-03-31T23:05:36.000Z | src/whylogs/util/data.py | NtiyisoN/whylogs-python | 25906260532c0210e5c4d905aa2a6ee11ae58ad5 | [
"Apache-2.0"
] | 284 | 2021-03-02T21:28:03.000Z | 2022-03-31T22:36:08.000Z | src/whylogs/util/data.py | jamie256/whylogs | e4b8288a61c00fbe033c0248a015e6e91ee6c8b0 | [
"Apache-2.0"
] | 39 | 2020-08-14T21:22:08.000Z | 2022-03-29T20:24:54.000Z | """
Utility functions for interacting with data
"""
from collections import OrderedDict
def getter(x, k: str, *args):
"""
get an attribute (from an object) or key (from a dict-like object)
`getter(x, k)` raise KeyError if `k` not present
`getter(x, k, default)` return default if `k` not present
... | 25.586777 | 79 | 0.552649 | from collections import OrderedDict
def getter(x, k: str, *args):
try:
try:
val = x[k]
except TypeError:
try:
val = getattr(x, k)
except AttributeError:
raise KeyError
except KeyError... | true | true |
1c258ba9ae7fb5f5b28d0990329a99b335be0875 | 1,156 | py | Python | api/src/dto/SpeakDto.py | SamuelJansen/voice-api | 6e143e01ad3e06d4f836646f024d3ca06cb37efa | [
"MIT"
] | 2 | 2022-02-07T12:22:13.000Z | 2022-03-04T02:42:55.000Z | api/src/dto/SpeakDto.py | SamuelJansen/voice-api | 6e143e01ad3e06d4f836646f024d3ca06cb37efa | [
"MIT"
] | null | null | null | api/src/dto/SpeakDto.py | SamuelJansen/voice-api | 6e143e01ad3e06d4f836646f024d3ca06cb37efa | [
"MIT"
] | null | null | null | from python_helper import ObjectHelper
from converter.static import SpeakConverterStatic
class SpeakRequestDto:
def __init__(self,
text = None,
voice = None,
path = None,
name = None,
extension = None,
muted = None
):
self.text = text
self.voice =... | 27.52381 | 70 | 0.602076 | from python_helper import ObjectHelper
from converter.static import SpeakConverterStatic
class SpeakRequestDto:
def __init__(self,
text = None,
voice = None,
path = None,
name = None,
extension = None,
muted = None
):
self.text = text
self.voice =... | true | true |
1c258bd71061d1985c1496ddfb44a26cfe281796 | 12,175 | py | Python | plugins/m/plots.py | DarkContact/m.css | a56227e89de90d0ea5751d0ebfa96734a5e55b96 | [
"MIT"
] | null | null | null | plugins/m/plots.py | DarkContact/m.css | a56227e89de90d0ea5751d0ebfa96734a5e55b96 | [
"MIT"
] | 1 | 2020-06-08T15:13:08.000Z | 2020-06-08T15:13:08.000Z | plugins/m/plots.py | DarkContact/m.css | a56227e89de90d0ea5751d0ebfa96734a5e55b96 | [
"MIT"
] | null | null | null | #
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019 Vladimír Vondruš <mosra@centrum.cz>
#
# 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... | 42.56993 | 189 | 0.631458 |
import re
from docutils import nodes, utils
from docutils.parsers import rst
from docutils.parsers.rst import directives
from docutils.parsers.rst.roles import set_classes
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import io
mpl.rcParams['font.... | true | true |
1c258c5100dc02117048fd7668051ec11a4da9c1 | 679 | py | Python | core/middleware.py | baxtea/pipeline | 0cbdd4b3ee6d05611e1d3ed5a4936f597182e963 | [
"MIT"
] | 18 | 2018-11-14T21:52:33.000Z | 2022-03-23T08:10:54.000Z | core/middleware.py | baxtea/pipeline | 0cbdd4b3ee6d05611e1d3ed5a4936f597182e963 | [
"MIT"
] | 83 | 2018-09-21T16:08:51.000Z | 2022-03-27T20:31:05.000Z | core/middleware.py | baxtea/pipeline | 0cbdd4b3ee6d05611e1d3ed5a4936f597182e963 | [
"MIT"
] | 6 | 2019-09-27T20:50:54.000Z | 2020-06-12T14:07:38.000Z | from django.shortcuts import redirect
from core.models import MigrationInformation
class MigrationRedirectMiddleware:
"""Attempt to redirect from migrated WordPress URLs to new Pipeline URLs on 404."""
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request... | 29.521739 | 87 | 0.687776 | from django.shortcuts import redirect
from core.models import MigrationInformation
class MigrationRedirectMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = self.get_response(request)
if response.status_code == 404:... | true | true |
1c258cf81adf5d945af572ebab61095ec499353b | 20,144 | py | Python | pox/messenger/__init__.py | TummanapallyAnuraag/pox | 4c3cd64fbbdb2e28549a35d2411c09003971bb00 | [
"Apache-2.0"
] | 6 | 2020-10-25T03:38:02.000Z | 2021-12-14T01:17:13.000Z | pox/messenger/__init__.py | TummanapallyAnuraag/pox | 4c3cd64fbbdb2e28549a35d2411c09003971bb00 | [
"Apache-2.0"
] | 2 | 2019-10-17T10:45:53.000Z | 2021-08-03T19:01:43.000Z | OFCONTROLLERS/pox/pox/messenger/__init__.py | ViniGarcia/NIEP | 5cdf779795b9248e1bbc12195479083475f3edab | [
"MIT"
] | 9 | 2015-04-21T04:22:20.000Z | 2021-10-31T22:57:05.000Z | # Copyright 2011,2012 James McCauley
#
# 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 ... | 29.067821 | 78 | 0.667345 |
from pox.lib.revent.revent import *
from pox.core import core as core
import json
import time
import random
import hashlib
from base64 import b32encode
log = core.getLogger()
defaultDecoder = json.JSONDecoder()
class ChannelJoin (Event):
def __init__ (self, connection, channel, msg = {}):
self... | true | true |
1c258e366a1f2730fba3b50e49ed467a1ff21215 | 19,832 | py | Python | model.py | telecombcn-dl/2017-dlai-team3 | f5438c573fb3a733dcd2ab3aaae466c01a8c65ff | [
"MIT"
] | 3 | 2020-06-19T01:28:47.000Z | 2022-01-03T17:01:50.000Z | model.py | telecombcn-dl/2017-dlai-team3 | f5438c573fb3a733dcd2ab3aaae466c01a8c65ff | [
"MIT"
] | null | null | null | model.py | telecombcn-dl/2017-dlai-team3 | f5438c573fb3a733dcd2ab3aaae466c01a8c65ff | [
"MIT"
] | 3 | 2019-07-01T05:24:34.000Z | 2022-01-03T17:02:34.000Z | import tensorlayer as tl
import tensorflow as tf
import os
from tensorlayer.layers import *
from data_input import DataInput
from utils import norm_img, denorm_img
import argparse
from PIL import Image
DEFAULT_DATA_FACES_PATH = "/storage/dataset"
DEFAULT_DATA_AUDIOS_PATH = "/storage/dataset_videos/cropped_videos/outpu... | 57.819242 | 140 | 0.617588 | import tensorlayer as tl
import tensorflow as tf
import os
from tensorlayer.layers import *
from data_input import DataInput
from utils import norm_img, denorm_img
import argparse
from PIL import Image
DEFAULT_DATA_FACES_PATH = "/storage/dataset"
DEFAULT_DATA_AUDIOS_PATH = "/storage/dataset_videos/cropped_videos/outpu... | false | true |
1c258ea04ccbe3cd37ccb1e75a3b3178c4c50add | 973 | py | Python | Exercicios/ex068.py | HenriqueSOliver/Python_CursoEmVideo | 6a8ab0c0fa3443990fc0bbbd817314065cf4e01b | [
"MIT"
] | 1 | 2021-04-08T19:54:01.000Z | 2021-04-08T19:54:01.000Z | Python (3)/Ex_finalizados/ex068.py | Gafanhoto742/Python-3 | b0a13ec4cf60185af3ed2508fc69188e36415b80 | [
"MIT"
] | null | null | null | Python (3)/Ex_finalizados/ex068.py | Gafanhoto742/Python-3 | b0a13ec4cf60185af3ed2508fc69188e36415b80 | [
"MIT"
] | null | null | null | '''Faça um programa que jogue par ou ímpar com o computador. O jogo só será interrompido quando o jogador perder,
mostrando o total de vitórias consecutivas que ele conquistou no final do jogo. '''
from random import randint
v = 0 #vitoria
while True:
jogador = int(input('Diga um valor: '))
computador = randi... | 34.75 | 114 | 0.567318 |
from random import randint
v = 0
while True:
jogador = int(input('Diga um valor: '))
computador = randint (0,10)
total = jogador + computador
tipo = ' '
while tipo not in 'PpIi':
tipo = str(input('Par ou Impar? [P/I] ')).strip().upper()[0]
print(f'Você jogou {jogador} e o computador {c... | true | true |
1c258ea5dbdfc8584f1d8a5f8543d499b7b41f22 | 611 | py | Python | ParticleTest.py | asurafire/PSO | f276e58fc661a7de8bc070bbf2576ac13a28b480 | [
"MIT"
] | null | null | null | ParticleTest.py | asurafire/PSO | f276e58fc661a7de8bc070bbf2576ac13a28b480 | [
"MIT"
] | null | null | null | ParticleTest.py | asurafire/PSO | f276e58fc661a7de8bc070bbf2576ac13a28b480 | [
"MIT"
] | null | null | null | import Particle
from Particle import Particle
from Functions import fun1, fun2, rosenbrock, rastrigin, himmelblau
from numpy import sin, cos, e
import numpy as np
f = himmelblau
domain = 6
particles = []
for n in range(10):
for i in range(50):
particles += [Particle(0.5, 0.5, 0.75, domain * 2, f)]
for ... | 29.095238 | 67 | 0.571195 | import Particle
from Particle import Particle
from Functions import fun1, fun2, rosenbrock, rastrigin, himmelblau
from numpy import sin, cos, e
import numpy as np
f = himmelblau
domain = 6
particles = []
for n in range(10):
for i in range(50):
particles += [Particle(0.5, 0.5, 0.75, domain * 2, f)]
for ... | true | true |
1c258f4aed63b223b05ffc4efff76638912a80ee | 5,077 | py | Python | networks/edsr_arch.py | qianpeisheng/SRFBN_CVPR19 | 44203216c4babbb8cefabb4f6dde811fdd6edb45 | [
"MIT"
] | 556 | 2019-03-20T08:27:50.000Z | 2022-03-27T18:51:19.000Z | networks/edsr_arch.py | SreeHarshaNelaturu/SRFBN_CVPR19 | 6ace659b743cea7ae1fc20ba4a505ee2fd7c75f9 | [
"MIT"
] | 59 | 2019-03-28T06:28:37.000Z | 2022-02-21T13:23:36.000Z | networks/edsr_arch.py | SreeHarshaNelaturu/SRFBN_CVPR19 | 6ace659b743cea7ae1fc20ba4a505ee2fd7c75f9 | [
"MIT"
] | 149 | 2019-03-26T07:47:23.000Z | 2022-03-31T07:47:22.000Z | # Enhanced Deep Residual Networks for Single Image Super-Resolution
# https://arxiv.org/abs/1707.02921
import math
import torch
import torch.nn as nn
def default_conv(in_channels, out_channels, kernel_size, bias=True):
return nn.Conv2d(
in_channels, out_channels, kernel_size,
padding=(kernel_size... | 32.754839 | 122 | 0.537719 |
import math
import torch
import torch.nn as nn
def default_conv(in_channels, out_channels, kernel_size, bias=True):
return nn.Conv2d(
in_channels, out_channels, kernel_size,
padding=(kernel_size//2), bias=bias)
class MeanShift(nn.Conv2d):
def __init__(
self, rgb_range=255,
... | true | true |
1c258f6feffe6f11f766a99d6915f8d806b4be8c | 898 | py | Python | utils/factory.py | sajjadahmadish/PyCIL | bc8cb714edb8ec7815f51fe008c43ea4967a9b57 | [
"MIT"
] | null | null | null | utils/factory.py | sajjadahmadish/PyCIL | bc8cb714edb8ec7815f51fe008c43ea4967a9b57 | [
"MIT"
] | null | null | null | utils/factory.py | sajjadahmadish/PyCIL | bc8cb714edb8ec7815f51fe008c43ea4967a9b57 | [
"MIT"
] | null | null | null | from models.der import DER
from models.ewc import EWC
from models.finetune import Finetune
from models.gem import GEM
from models.icarl import iCaRL
from models.lwf import LwF
from models.replay import Replay
from models.bic import BiC
from models.podnet import PODNet
from models.wa import WA
def get_model(model_name... | 24.27027 | 36 | 0.625835 | from models.der import DER
from models.ewc import EWC
from models.finetune import Finetune
from models.gem import GEM
from models.icarl import iCaRL
from models.lwf import LwF
from models.replay import Replay
from models.bic import BiC
from models.podnet import PODNet
from models.wa import WA
def get_model(model_name... | true | true |
1c258ff8a9feededc702d18ddb4fd53caf83686b | 357 | py | Python | TRANSFORM/Resources/Scripts/jModelica/Math/Examples/check_smoothMin.py | greenwoodms/TRANSFORM-Library | dc152d4f0298d3f18385f2ea33645d87d7812915 | [
"Apache-2.0"
] | 29 | 2018-04-24T17:06:19.000Z | 2021-11-21T05:17:28.000Z | TRANSFORM/Resources/Scripts/jModelica/Math/Examples/check_smoothMin.py | greenwoodms/TRANSFORM-Library | dc152d4f0298d3f18385f2ea33645d87d7812915 | [
"Apache-2.0"
] | 13 | 2018-04-05T08:34:27.000Z | 2021-10-04T14:24:41.000Z | TRANSFORM/Resources/Scripts/jModelica/Math/Examples/check_smoothMin.py | greenwoodms/TRANSFORM-Library | dc152d4f0298d3f18385f2ea33645d87d7812915 | [
"Apache-2.0"
] | 17 | 2018-08-06T22:18:01.000Z | 2022-01-29T21:38:17.000Z | from pymodelica import compile_fmu
from pyfmi import load_fmu
libPath = r'C:\Users\vmg\Documents\Modelica\TRANSFORM-Library/TRANSFORM'
modelName = 'TRANSFORM.Math.Examples.check_smoothMin'
fmu = compile_fmu(modelName,libPath,target='cs')
model = load_fmu(fmu)
opts = model.simulate_options()
opts['time_limit'] = 60
... | 25.5 | 72 | 0.795518 | from pymodelica import compile_fmu
from pyfmi import load_fmu
libPath = r'C:\Users\vmg\Documents\Modelica\TRANSFORM-Library/TRANSFORM'
modelName = 'TRANSFORM.Math.Examples.check_smoothMin'
fmu = compile_fmu(modelName,libPath,target='cs')
model = load_fmu(fmu)
opts = model.simulate_options()
opts['time_limit'] = 60
... | true | true |
1c2590163a664b0804406933206eebc38a2990d5 | 234 | py | Python | model-serving/tests/conftest.py | raman-nbg/model-serving | bf342f123bcb73ef95e25f3b76a1c8440616c548 | [
"MIT"
] | null | null | null | model-serving/tests/conftest.py | raman-nbg/model-serving | bf342f123bcb73ef95e25f3b76a1c8440616c548 | [
"MIT"
] | null | null | null | model-serving/tests/conftest.py | raman-nbg/model-serving | bf342f123bcb73ef95e25f3b76a1c8440616c548 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Dummy conftest.py for model_serving.
If you don't know what this is for, just leave it empty.
Read more about conftest.py under:
https://pytest.org/latest/plugins.html
"""
# import pytest
| 21.272727 | 60 | 0.65812 | true | true | |
1c259070b6e33823530d561186c0c86c05ce787d | 2,323 | py | Python | scripts/swagger_update/test_swagger_update.py | damoodamoo/azbrowse | 219b40508e4570a9bc3f7a2b73cf80921180ab3e | [
"MIT"
] | null | null | null | scripts/swagger_update/test_swagger_update.py | damoodamoo/azbrowse | 219b40508e4570a9bc3f7a2b73cf80921180ab3e | [
"MIT"
] | null | null | null | scripts/swagger_update/test_swagger_update.py | damoodamoo/azbrowse | 219b40508e4570a9bc3f7a2b73cf80921180ab3e | [
"MIT"
] | null | null | null | import pytest
from api_set import *
def test_get_api_version_from_readme_with_invalid_file_path_returns_none():
dummy_overrides = {}
dummy_includes = {}
result = get_api_version_from_readme(
"dummy",
"./scripts/swagger_update/test_data/does_not_exist.md",
dummy_overrides,
... | 30.168831 | 101 | 0.689195 | import pytest
from api_set import *
def test_get_api_version_from_readme_with_invalid_file_path_returns_none():
dummy_overrides = {}
dummy_includes = {}
result = get_api_version_from_readme(
"dummy",
"./scripts/swagger_update/test_data/does_not_exist.md",
dummy_overrides,
... | true | true |
1c2590eed28aad88c8767aa2e62d611a9b5e658e | 4,655 | py | Python | td_learning_maze.py | gabrielesartor/td_learning_maze | c7b561c88b68eee3f87aa723ab182c592ebc440a | [
"BSD-3-Clause"
] | null | null | null | td_learning_maze.py | gabrielesartor/td_learning_maze | c7b561c88b68eee3f87aa723ab182c592ebc440a | [
"BSD-3-Clause"
] | null | null | null | td_learning_maze.py | gabrielesartor/td_learning_maze | c7b561c88b68eee3f87aa723ab182c592ebc440a | [
"BSD-3-Clause"
] | null | null | null | import sys
import numpy as np
import math
import random
import time
import matplotlib.pyplot as plt
import pickle
import gym
import gym_maze
"""
Implementation of TD methods for the maze environment.
(you can find the environment here: https://github.com/MattChanTK/gym-maze)
"""
#Simulation parameters
NUM_EPISODES =... | 31.452703 | 178 | 0.627712 | import sys
import numpy as np
import math
import random
import time
import matplotlib.pyplot as plt
import pickle
import gym
import gym_maze
NUM_EPISODES = 10000
MAX_T = 100
ALPHA = 0.5
GAMMA = 0.9
EPSILON = 0.2
DEBUG = False
RENDER_POLICY = True
MEAN_RANGE = 10
MIN_REWARD = -0.1
MAX_REWARD = 1.0
NUM_EPISODES_PLO... | true | true |
1c2590f7a7e5a2023027789ed6a0c621c0a44880 | 990 | py | Python | pirates/quest/QuestIndicatorNodeNPCOffset.py | ksmit799/POTCO-PS | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 8 | 2017-01-24T04:33:29.000Z | 2020-11-01T08:36:24.000Z | pirates/quest/QuestIndicatorNodeNPCOffset.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 1 | 2017-03-02T18:05:17.000Z | 2017-03-14T06:47:10.000Z | pirates/quest/QuestIndicatorNodeNPCOffset.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 11 | 2017-03-02T18:46:07.000Z | 2020-11-01T08:36:26.000Z | # File: Q (Python 2.4)
from pirates.quest.QuestIndicatorNodeNPC import QuestIndicatorNodeNPC
class QuestIndicatorNodeNPCOffset(QuestIndicatorNodeNPC):
def __init__(self, questStep):
QuestIndicatorNodeNPC.__init__(self, questStep)
self.wantBottomEffect = False
def startNearEffect(sel... | 30.9375 | 78 | 0.654545 |
from pirates.quest.QuestIndicatorNodeNPC import QuestIndicatorNodeNPC
class QuestIndicatorNodeNPCOffset(QuestIndicatorNodeNPC):
def __init__(self, questStep):
QuestIndicatorNodeNPC.__init__(self, questStep)
self.wantBottomEffect = False
def startNearEffect(self):
QuestIndic... | true | true |
1c259142cf2e666f9cb1ebb34e3efd80ce4963f9 | 4,401 | py | Python | Twitter_Bot_Defs.py | pinkrespect/Tweet_Bot_Maisie | e9f299c03d2a3d2c6eda685d775efa49a658362b | [
"MIT"
] | 1 | 2017-02-22T08:04:04.000Z | 2017-02-22T08:04:04.000Z | Twitter_Bot_Defs.py | pinkrespect/Tweet_Bot_Maisie | e9f299c03d2a3d2c6eda685d775efa49a658362b | [
"MIT"
] | null | null | null | Twitter_Bot_Defs.py | pinkrespect/Tweet_Bot_Maisie | e9f299c03d2a3d2c6eda685d775efa49a658362b | [
"MIT"
] | null | null | null | """
여기 있는 함수들은 멘션에 쓰일 메세지를 생성하거나,
멘션을 보낼지 말지에 대한 판단을 합니다.
"""
from urllib.parse import quote
def my_name_index(new_text, my_name):
'''
my_name_index.
해당 mention string에서 my_name 스트링이 위치하는 곳을 찾아서
단어 시작 index와 단어 종료 index를 추출합니다.
'''
if my_name + " " in new_text:
my_name_len = len(my_na... | 38.605263 | 123 | 0.579641 | from urllib.parse import quote
def my_name_index(new_text, my_name):
if my_name + " " in new_text:
my_name_len = len(my_name)+1
elif my_name in new_text:
my_name_len = len(my_name)
start_index = new_text.find(my_name)
end_index = start_index + my_name_len
return start_index, end_i... | true | true |
1c2593b8b2a92aa7ca70cf53111ed6d83d4a5349 | 3,963 | py | Python | src/secml/ml/features/normalization/c_normalizer_linear.py | zangobot/secml | 95a293e1201c24256eb7fe2f1d2125cd5f318c8c | [
"Apache-2.0"
] | 63 | 2020-04-20T16:31:16.000Z | 2022-03-29T01:05:35.000Z | src/secml/ml/features/normalization/c_normalizer_linear.py | zangobot/secml | 95a293e1201c24256eb7fe2f1d2125cd5f318c8c | [
"Apache-2.0"
] | 5 | 2020-04-21T11:31:39.000Z | 2022-03-24T13:42:56.000Z | src/secml/ml/features/normalization/c_normalizer_linear.py | zangobot/secml | 95a293e1201c24256eb7fe2f1d2125cd5f318c8c | [
"Apache-2.0"
] | 8 | 2020-04-21T09:16:42.000Z | 2022-02-23T16:28:43.000Z | """
.. module:: CNormalizerLinear
:synopsis: Interface for linear normalizers.
.. moduleauthor:: Marco Melis <marco.melis@unica.it>
"""
from abc import abstractmethod
from secml.core.decorators import deprecated
from secml.array import CArray
from secml.ml.features.normalization import CNormalizer
from secml.util... | 30.251908 | 79 | 0.60106 | from abc import abstractmethod
from secml.core.decorators import deprecated
from secml.array import CArray
from secml.ml.features.normalization import CNormalizer
from secml.utils.mixed_utils import check_is_fitted
class CNormalizerLinear(CNormalizer):
@property
@abstractmethod
def w(self):
... | true | true |
1c2596b619132425505144b1a5b241b14063c84d | 837 | py | Python | test/test_organization.py | awalker125/gitea-api | 2dea0493d4b6a92d6e63a7284afb2c80cbf35cf7 | [
"MIT"
] | null | null | null | test/test_organization.py | awalker125/gitea-api | 2dea0493d4b6a92d6e63a7284afb2c80cbf35cf7 | [
"MIT"
] | null | null | null | test/test_organization.py | awalker125/gitea-api | 2dea0493d4b6a92d6e63a7284afb2c80cbf35cf7 | [
"MIT"
] | 1 | 2022-01-27T14:12:40.000Z | 2022-01-27T14:12:40.000Z | # coding: utf-8
"""
Gitea API.
This documentation describes the Gitea API. # noqa: E501
OpenAPI spec version: 1.15.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import gitea_api
from gitea_api.models.organizatio... | 20.414634 | 79 | 0.686977 |
from __future__ import absolute_import
import unittest
import gitea_api
from gitea_api.models.organization import Organization
from gitea_api.rest import ApiException
class TestOrganization(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testOrganization(s... | true | true |
1c2597d8350e9696b2457f7b601c82a6f9056b0f | 6,832 | py | Python | api_rest/tests/entrenador/tests_entrenador.py | XrossFox/maquina-de-aspectos | e124167154cac2355278f309e2b3153e723a8c47 | [
"MIT"
] | null | null | null | api_rest/tests/entrenador/tests_entrenador.py | XrossFox/maquina-de-aspectos | e124167154cac2355278f309e2b3153e723a8c47 | [
"MIT"
] | null | null | null | api_rest/tests/entrenador/tests_entrenador.py | XrossFox/maquina-de-aspectos | e124167154cac2355278f309e2b3153e723a8c47 | [
"MIT"
] | 1 | 2019-01-22T21:21:46.000Z | 2019-01-22T21:21:46.000Z | import sys
sys.path.append('../../api_rest')
import unittest
from entrenador import entrenador
import os.path
import configuracion_api_rest
class Test(unittest.TestCase):
def setUp(self):
self.entrenador = entrenador.Entrenador()
self.test_data_path_correcto = "./datasets_tests_1"
self.te... | 40.188235 | 107 | 0.632319 | import sys
sys.path.append('../../api_rest')
import unittest
from entrenador import entrenador
import os.path
import configuracion_api_rest
class Test(unittest.TestCase):
def setUp(self):
self.entrenador = entrenador.Entrenador()
self.test_data_path_correcto = "./datasets_tests_1"
self.te... | true | true |
1c25993c0c3cfefa42e58028c11afe254f13513b | 874 | py | Python | src/estimators.py | mkashifn/celosia | 2caa776620b9e7c3f63c41329f10c8c91fb4857f | [
"MIT"
] | null | null | null | src/estimators.py | mkashifn/celosia | 2caa776620b9e7c3f63c41329f10c8c91fb4857f | [
"MIT"
] | null | null | null | src/estimators.py | mkashifn/celosia | 2caa776620b9e7c3f63c41329f10c8c91fb4857f | [
"MIT"
] | null | null | null | #!/bin/python
import numpy as np
from functions import softmax
class Estimator:
def __init__(self):
pass
def __call__(self, A, B):
return self.fx(A, B)
def fx(self, A, B):
return 0
def dfx(self, A, B):
return 0
class MSE(Estimator):
def __init__(self):
pass
def fx(self, A, B):
retu... | 21.317073 | 51 | 0.599542 |
import numpy as np
from functions import softmax
class Estimator:
def __init__(self):
pass
def __call__(self, A, B):
return self.fx(A, B)
def fx(self, A, B):
return 0
def dfx(self, A, B):
return 0
class MSE(Estimator):
def __init__(self):
pass
def fx(self, A, B):
return np.square(... | true | true |
1c259a8a6a9704894ec2b449880514af4318842f | 2,404 | py | Python | code/math_utils.py | sorozcov/proyecto-iv-ugr | a7fddf1b5efca18d4b7e09c3e199c602d4e107ef | [
"MIT"
] | null | null | null | code/math_utils.py | sorozcov/proyecto-iv-ugr | a7fddf1b5efca18d4b7e09c3e199c602d4e107ef | [
"MIT"
] | 36 | 2021-09-28T11:26:00.000Z | 2022-02-10T00:55:06.000Z | code/math_utils.py | sorozcov/proyecto-iv-ugr | a7fddf1b5efca18d4b7e09c3e199c602d4e107ef | [
"MIT"
] | 1 | 2021-11-15T10:40:54.000Z | 2021-11-15T10:40:54.000Z |
# Funcion para hacer flat un arreglo
def flatten_array(array):
return [item for sublist in array for item in sublist]
# Funcion para calcular matriz transpuesta
def transpose(matA):
transMatrix=[[0 for j in range(len(matA))] for i in range(len(matA[0]))]
for i in range(len(matA)):
for j in range(... | 31.220779 | 77 | 0.627288 |
def flatten_array(array):
return [item for sublist in array for item in sublist]
def transpose(matA):
transMatrix=[[0 for j in range(len(matA))] for i in range(len(matA[0]))]
for i in range(len(matA)):
for j in range(len(matA[0])):
transMatrix[j][i]=matA[i][j]
return transMatrix... | true | true |
1c259d4eae945e3c01b21e05cd79a4c6620562c2 | 353 | py | Python | 11/Compiler/preprocessor.py | thinker1990/nand2tetris | 5df492cc63187c774cc77cd4d689d32f4363e685 | [
"MIT"
] | null | null | null | 11/Compiler/preprocessor.py | thinker1990/nand2tetris | 5df492cc63187c774cc77cd4d689d32f4363e685 | [
"MIT"
] | null | null | null | 11/Compiler/preprocessor.py | thinker1990/nand2tetris | 5df492cc63187c774cc77cd4d689d32f4363e685 | [
"MIT"
] | null | null | null | from re import sub
class Preprocessor:
def process(self, text):
txt = self.remove_comment(text)
return self.remove_whitespace(txt)
def remove_comment(self, text):
txt = sub(r'//.*', '', text)
return sub(r'/\*[\s\S]*?\*/', '', txt)
def remove_whitespace(self, text):
... | 22.0625 | 46 | 0.563739 | from re import sub
class Preprocessor:
def process(self, text):
txt = self.remove_comment(text)
return self.remove_whitespace(txt)
def remove_comment(self, text):
txt = sub(r'//.*', '', text)
return sub(r'/\*[\s\S]*?\*/', '', txt)
def remove_whitespace(self, text):
... | true | true |
1c259f86a93699cb18a048b15a52a693445481a3 | 1,288 | py | Python | python/dgl/utils/shared_mem.py | lfchener/dgl | 77f4287a4118db64c46f4f413a426e1419a09d53 | [
"Apache-2.0"
] | 9,516 | 2018-12-08T22:11:31.000Z | 2022-03-31T13:04:33.000Z | python/dgl/utils/shared_mem.py | lfchener/dgl | 77f4287a4118db64c46f4f413a426e1419a09d53 | [
"Apache-2.0"
] | 2,494 | 2018-12-08T22:43:00.000Z | 2022-03-31T21:16:27.000Z | python/dgl/utils/shared_mem.py | lfchener/dgl | 77f4287a4118db64c46f4f413a426e1419a09d53 | [
"Apache-2.0"
] | 2,529 | 2018-12-08T22:56:14.000Z | 2022-03-31T13:07:41.000Z |
"""Shared memory utilities."""
from .. import backend as F
from .._ffi.ndarray import empty_shared_mem
def get_shared_mem_array(name, shape, dtype):
""" Get a tensor from shared memory with specific name
Parameters
----------
name : str
The unique name of the shared memory
shape : tuple o... | 26.285714 | 83 | 0.647516 |
from .. import backend as F
from .._ffi.ndarray import empty_shared_mem
def get_shared_mem_array(name, shape, dtype):
name = 'DGL_'+name
new_arr = empty_shared_mem(name, False, shape, F.reverse_data_type_dict[dtype])
dlpack = new_arr.to_dlpack()
return F.zerocopy_from_dlpack(dlpack)
def create_shared... | true | true |
1c259fb56c33fbb7383dd7210c62772d6cb378ac | 11,735 | py | Python | ttbd/conf_00_lib_capture.py | jhaapako/tcf | ecd75404459c6fec9d9fa1522b70a8deab896644 | [
"Apache-2.0"
] | 24 | 2018-08-21T18:04:48.000Z | 2022-02-07T22:50:06.000Z | ttbd/conf_00_lib_capture.py | jhaapako/tcf | ecd75404459c6fec9d9fa1522b70a8deab896644 | [
"Apache-2.0"
] | 16 | 2018-08-21T18:03:52.000Z | 2022-03-01T17:15:42.000Z | ttbd/conf_00_lib_capture.py | jhaapako/tcf | ecd75404459c6fec9d9fa1522b70a8deab896644 | [
"Apache-2.0"
] | 29 | 2018-08-22T19:40:59.000Z | 2021-12-21T11:13:23.000Z | #! /usr/bin/python3
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
#
""".. _conf_00_lib_capture:
Configuration API for capturing audio and video
-----------------------------------------------
These capture objects are meant to be fed to the capture interface
declaration of a targe... | 36.557632 | 124 | 0.658713 |
import signal
import ttbl.capture
#: :class:`ttbl.capture.generic_snapshot` and
#: :class:`ttbl.capture.generic_stream`.
#:
#: To use:
#:
#: - define a target
#:
#: - physically connect the capture interface to it and to the
#: server
#:
#: - Create a *udev* configuration so the capture device expos... | true | true |
1c259fc246d2b23918c8f72e7e8404dd6620486b | 572 | py | Python | scripts/startdownloads.py | zxcmehran/LoadBox | 7c16a6d55d1bba1457439755bd9dcc7848b7274e | [
"MIT"
] | 7 | 2015-12-19T23:17:14.000Z | 2021-01-29T18:26:39.000Z | scripts/startdownloads.py | zxcmehran/LoadBox | 7c16a6d55d1bba1457439755bd9dcc7848b7274e | [
"MIT"
] | null | null | null | scripts/startdownloads.py | zxcmehran/LoadBox | 7c16a6d55d1bba1457439755bd9dcc7848b7274e | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
LoadBox Downloader Toolset for Unix-Based Systems
For more info:
http://github.com/zxcmehran/LoadBox
Developed by Mehran Ahadi
http://mehran.ahadi.me/
Licensed undet MIT (Expat) License
'''
import xmlrpclib
import configuration as c
try:
s = xmlrpclib.ServerProxy(c.conf_protocol()+c.conf_au... | 20.428571 | 110 | 0.723776 |
'''
LoadBox Downloader Toolset for Unix-Based Systems
For more info:
http://github.com/zxcmehran/LoadBox
Developed by Mehran Ahadi
http://mehran.ahadi.me/
Licensed undet MIT (Expat) License
'''
import xmlrpclib
import configuration as c
try:
s = xmlrpclib.ServerProxy(c.conf_protocol()+c.conf_auth_userpass()+c.c... | false | true |
1c25a0900008a52dae20f9d8b95cb906fab019a7 | 15,850 | py | Python | jax/lib/xla_bridge.py | akihironitta/jax | c67454d0f85dd786b09ba2944bb629f3c88302f2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/lib/xla_bridge.py | akihironitta/jax | c67454d0f85dd786b09ba2944bb629f3c88302f2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/lib/xla_bridge.py | akihironitta/jax | c67454d0f85dd786b09ba2944bb629f3c88302f2 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-09-16T11:34:14.000Z | 2020-09-16T11:34:14.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.104784 | 98 | 0.730852 |
from functools import partial
import os
from typing import Callable, Dict, Tuple, Union
import warnings
from absl import logging
from ..config import flags
from .. import util
from .. import dtypes
import numpy as np
import threading
try:
from . import tpu_client
except ImportError:
tpu_client = ... | true | true |
1c25a20e8a75db10454451ffd65daee4ea55526b | 1,077 | py | Python | Chapter08/Exercise8.03/media_project/media_example/tests.py | PacktPublishing/Web-Development-Projects-with-Django | 531bc4d58d614888cc81b7fd6f8ec859f5a65217 | [
"MIT"
] | 97 | 2021-03-01T12:54:30.000Z | 2022-03-28T02:57:26.000Z | Chapter08/Exercise8.03/media_project/media_example/tests.py | PacktPublishing/Web-Development-Projects-with-Django | 531bc4d58d614888cc81b7fd6f8ec859f5a65217 | [
"MIT"
] | 81 | 2020-08-27T04:56:04.000Z | 2022-03-12T00:53:40.000Z | Chapter08/Exercise8.03/media_project/media_example/tests.py | PacktPublishing/Web-Development-Projects-with-Django | 531bc4d58d614888cc81b7fd6f8ec859f5a65217 | [
"MIT"
] | 163 | 2020-12-25T14:38:38.000Z | 2022-03-30T10:31:40.000Z | import os
from io import BytesIO
from urllib.request import urlopen
from django.conf import settings
from django.test import LiveServerTestCase, Client
class Exercise3Test(LiveServerTestCase):
def test_media_example_upload(self):
"""
Test the upload functionality to the media_example view. Check ... | 31.676471 | 98 | 0.63324 | import os
from io import BytesIO
from urllib.request import urlopen
from django.conf import settings
from django.test import LiveServerTestCase, Client
class Exercise3Test(LiveServerTestCase):
def test_media_example_upload(self):
test_data = b'some test data'
filename = 'exercise_3_test.txt'
... | true | true |
1c25a26a2e3f1d6ff1fb7409b9c51ee56488b5f9 | 13,246 | py | Python | tests/chart/test_chart.py | CAVOK-IT/python-pptx | ebbac1e44e36ef54c50097f38df0d94aa60ebc84 | [
"MIT"
] | null | null | null | tests/chart/test_chart.py | CAVOK-IT/python-pptx | ebbac1e44e36ef54c50097f38df0d94aa60ebc84 | [
"MIT"
] | null | null | null | tests/chart/test_chart.py | CAVOK-IT/python-pptx | ebbac1e44e36ef54c50097f38df0d94aa60ebc84 | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
Test suite for pptx.chart.chart module
"""
from __future__ import absolute_import, print_function
import pytest
from pptx.chart.axis import CategoryAxis, ValueAxis
from pptx.chart.chart import Chart, Legend, _Plots
from pptx.chart.data import ChartData
from pptx.chart.plot import _BasePlot
fro... | 35.897019 | 77 | 0.667371 |
from __future__ import absolute_import, print_function
import pytest
from pptx.chart.axis import CategoryAxis, ValueAxis
from pptx.chart.chart import Chart, Legend, _Plots
from pptx.chart.data import ChartData
from pptx.chart.plot import _BasePlot
from pptx.chart.series import SeriesCollection
from pptx.chart.xmlw... | true | true |
1c25a50d77de1354d3f41c3e44da1f3a6474cf13 | 18,164 | py | Python | pysmt/solvers/solver.py | Ying1123/pysmt | 7aa2835ba46f69bfd7ca8004a3e0d1da6a4c94fa | [
"Apache-2.0"
] | null | null | null | pysmt/solvers/solver.py | Ying1123/pysmt | 7aa2835ba46f69bfd7ca8004a3e0d1da6a4c94fa | [
"Apache-2.0"
] | null | null | null | pysmt/solvers/solver.py | Ying1123/pysmt | 7aa2835ba46f69bfd7ca8004a3e0d1da6a4c94fa | [
"Apache-2.0"
] | null | null | null | #
# This file is part of pySMT.
#
# Copyright 2014 Andrea Micheli and Marco Gario
#
# 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
... | 31.922671 | 98 | 0.623706 |
from six.moves import xrange
from pysmt.typing import BOOL
from pysmt.solvers.options import SolverOptions
from pysmt.decorators import clear_pending_pop
from pysmt.exceptions import (SolverReturnedUnknownResultError, PysmtValueError,
SolverNotConfiguredForUnsatCoresError... | true | true |
1c25a52e59061794b055a10f7c8793b8fe4c5164 | 405 | py | Python | Django_Project/asgi.py | shadowstriker15/Online_Ripper | 0a78cb9d5955a9889baa57f33d5281b99707f640 | [
"MIT"
] | null | null | null | Django_Project/asgi.py | shadowstriker15/Online_Ripper | 0a78cb9d5955a9889baa57f33d5281b99707f640 | [
"MIT"
] | null | null | null | Django_Project/asgi.py | shadowstriker15/Online_Ripper | 0a78cb9d5955a9889baa57f33d5281b99707f640 | [
"MIT"
] | null | null | null | """
ASGI config for Django_Project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Django_Project.settings')
application = get_asgi_application()
| true | true |
1c25a62c67fdbe7aa7a6b96b31f22ba0aae158f4 | 562 | py | Python | test_client.py | nalindas9/cartesian-ball-tracking | 3820e7d9a6eb3efd7691e80184ae3760d64f9889 | [
"MIT"
] | null | null | null | test_client.py | nalindas9/cartesian-ball-tracking | 3820e7d9a6eb3efd7691e80184ae3760d64f9889 | [
"MIT"
] | null | null | null | test_client.py | nalindas9/cartesian-ball-tracking | 3820e7d9a6eb3efd7691e80184ae3760d64f9889 | [
"MIT"
] | null | null | null | """@package docstring
Implements unit tests for testing client.py
"""
import pytest
import asyncio
from aiortc import RTCPeerConnection
from multiprocessing import Queue
from client import channel_log, channel_send, display_video
from server import BallBounceStreamTrack
def test_display_video_size():
"""
Te... | 20.071429 | 72 | 0.725979 | import pytest
import asyncio
from aiortc import RTCPeerConnection
from multiprocessing import Queue
from client import channel_log, channel_send, display_video
from server import BallBounceStreamTrack
def test_display_video_size():
queue = asyncio.run(display_video())
assert queue.qsize() > 0
| true | true |
1c25a67922313b6dbf8ee7b1e86fcb72bcb90ebc | 374 | py | Python | moto/apigateway/integration_parsers/http_parser.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 5,460 | 2015-01-01T01:11:17.000Z | 2022-03-31T23:45:38.000Z | moto/apigateway/integration_parsers/http_parser.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 4,475 | 2015-01-05T19:37:30.000Z | 2022-03-31T13:55:12.000Z | moto/apigateway/integration_parsers/http_parser.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 1,831 | 2015-01-14T00:00:44.000Z | 2022-03-31T20:30:04.000Z | import requests
class TypeHttpParser:
"""
Parse invocations to a APIGateway resource with integration type HTTP
"""
def invoke(self, request, integration):
uri = integration["uri"]
requests_func = getattr(requests, integration["httpMethod"].lower())
response = requests_func(ur... | 26.714286 | 76 | 0.684492 | import requests
class TypeHttpParser:
def invoke(self, request, integration):
uri = integration["uri"]
requests_func = getattr(requests, integration["httpMethod"].lower())
response = requests_func(uri)
return response.status_code, response.text
| true | true |
1c25a6c39831217b32cbaed42c9755b9bd09bf27 | 7,655 | py | Python | flexmeasures/cli/data_edit.py | FlexMeasures/flexmeasures | a4367976d37ac5721b8eb3ce8a2414595e52c678 | [
"Apache-2.0"
] | 12 | 2021-12-18T10:41:10.000Z | 2022-03-29T23:00:29.000Z | flexmeasures/cli/data_edit.py | FlexMeasures/flexmeasures | a4367976d37ac5721b8eb3ce8a2414595e52c678 | [
"Apache-2.0"
] | 103 | 2021-12-07T08:51:15.000Z | 2022-03-31T13:28:48.000Z | flexmeasures/cli/data_edit.py | FlexMeasures/flexmeasures | a4367976d37ac5721b8eb3ce8a2414595e52c678 | [
"Apache-2.0"
] | 3 | 2022-01-18T04:45:48.000Z | 2022-03-14T09:48:22.000Z | from datetime import timedelta
from typing import Union, List, Optional
import click
import pandas as pd
from flask import current_app as app
from flask.cli import with_appcontext
from flexmeasures import Sensor
from flexmeasures.data import db
from flexmeasures.data.schemas.generic_assets import GenericAssetIdField
... | 31.502058 | 189 | 0.679556 | from datetime import timedelta
from typing import Union, List, Optional
import click
import pandas as pd
from flask import current_app as app
from flask.cli import with_appcontext
from flexmeasures import Sensor
from flexmeasures.data import db
from flexmeasures.data.schemas.generic_assets import GenericAssetIdField
... | true | true |
1c25a6ec9fbb9db17b9c0e2859457f6e1722bd96 | 637 | py | Python | corehq/apps/reports/templatetags/timezone_tags.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | 1 | 2015-02-10T23:26:39.000Z | 2015-02-10T23:26:39.000Z | corehq/apps/reports/templatetags/timezone_tags.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/reports/templatetags/timezone_tags.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | null | null | null | import dateutil
from django import template
import pytz
from dimagi.utils.timezones import utils as tz_utils
import datetime
register = template.Library()
@register.simple_tag
def utc_to_timezone(date, timezone, dest_fmt="%b %d, %Y %H:%M %Z"):
if not timezone:
timezone = pytz.utc
if not date:
... | 31.85 | 97 | 0.697017 | import dateutil
from django import template
import pytz
from dimagi.utils.timezones import utils as tz_utils
import datetime
register = template.Library()
@register.simple_tag
def utc_to_timezone(date, timezone, dest_fmt="%b %d, %Y %H:%M %Z"):
if not timezone:
timezone = pytz.utc
if not date:
... | true | true |
1c25a81e34f0563dab29bb6e1d63273e1e739bbc | 91 | py | Python | src/main/java/com/rubin/demo/Utils/BaiduSerchImgApi-master/apps.py | LynnGu/Rubindemo | 0ffe52af74643db8d8bfae048ee256824836e277 | [
"MIT"
] | null | null | null | src/main/java/com/rubin/demo/Utils/BaiduSerchImgApi-master/apps.py | LynnGu/Rubindemo | 0ffe52af74643db8d8bfae048ee256824836e277 | [
"MIT"
] | null | null | null | src/main/java/com/rubin/demo/Utils/BaiduSerchImgApi-master/apps.py | LynnGu/Rubindemo | 0ffe52af74643db8d8bfae048ee256824836e277 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class SoutuappConfig(AppConfig):
name = 'soutuapp'
| 15.166667 | 33 | 0.758242 | from django.apps import AppConfig
class SoutuappConfig(AppConfig):
name = 'soutuapp'
| true | true |
1c25a83d7f3efa6f9086dcbc738184e3303e068a | 6,004 | py | Python | activitysim/abm/models/trip_mode_choice.py | LBNL-UCB-STI/activitysim | 7d88cf34c833d68068987bf8bf6af48a6ad706ec | [
"BSD-3-Clause"
] | null | null | null | activitysim/abm/models/trip_mode_choice.py | LBNL-UCB-STI/activitysim | 7d88cf34c833d68068987bf8bf6af48a6ad706ec | [
"BSD-3-Clause"
] | null | null | null | activitysim/abm/models/trip_mode_choice.py | LBNL-UCB-STI/activitysim | 7d88cf34c833d68068987bf8bf6af48a6ad706ec | [
"BSD-3-Clause"
] | null | null | null | # ActivitySim
# See full license in LICENSE.txt.
from builtins import zip
from builtins import range
import logging
import pandas as pd
from activitysim.core import simulate
from activitysim.core import tracing
from activitysim.core import config
from activitysim.core import inject
from activitysim.core import pipel... | 33.730337 | 96 | 0.659227 |
from builtins import zip
from builtins import range
import logging
import pandas as pd
from activitysim.core import simulate
from activitysim.core import tracing
from activitysim.core import config
from activitysim.core import inject
from activitysim.core import pipeline
from activitysim.core import orca
from acti... | true | true |
1c25a865462a70236a44c420da46bfaec97d902f | 10,074 | py | Python | costnotify.py | salvis2/costnotify | db0212edfa796e09d4d95b4c856c0ec06f9f7133 | [
"MIT"
] | null | null | null | costnotify.py | salvis2/costnotify | db0212edfa796e09d4d95b4c856c0ec06f9f7133 | [
"MIT"
] | null | null | null | costnotify.py | salvis2/costnotify | db0212edfa796e09d4d95b4c856c0ec06f9f7133 | [
"MIT"
] | null | null | null | import json
import os
import boto3
import zipfile
import csv
import datetime
import urllib
accountnumber = os.environ['accountnumber']
bucketname = os.environ['bucketname']
snstopic = os.environ['snstopic']
friendlyaccountname = os.environ['friendlyaccountname']
# for month-specific analysis
override = os.environ['ov... | 42.686441 | 126 | 0.589339 | import json
import os
import boto3
import zipfile
import csv
import datetime
import urllib
accountnumber = os.environ['accountnumber']
bucketname = os.environ['bucketname']
snstopic = os.environ['snstopic']
friendlyaccountname = os.environ['friendlyaccountname']
override = os.environ['override']
monthOverride = os.e... | true | true |
1c25a8ba4facdd57fbbbb2c974ca2b169f0e90bf | 3,817 | py | Python | calvin/actorstore/systemactors/net/TCPClient.py | gabrielcercel/calvin-base | c0315f100643230d65aed1745e1c22df3e7a7c2c | [
"Apache-2.0"
] | 334 | 2015-06-04T15:14:28.000Z | 2022-02-09T11:14:17.000Z | calvin/actorstore/systemactors/net/TCPClient.py | gabrielcercel/calvin-base | c0315f100643230d65aed1745e1c22df3e7a7c2c | [
"Apache-2.0"
] | 89 | 2015-06-13T19:15:35.000Z | 2019-12-03T19:23:20.000Z | calvin/actorstore/systemactors/net/TCPClient.py | gabrielcercel/calvin-base | c0315f100643230d65aed1745e1c22df3e7a7c2c | [
"Apache-2.0"
] | 112 | 2015-06-06T19:16:54.000Z | 2020-10-19T01:27:55.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | 31.808333 | 123 | 0.626146 |
from calvin.actor.actor import Actor, manage, condition, stateguard, calvinlib, calvinsys
from calvin.utilities.calvinlogger import get_logger
_log = get_logger(__name__)
class TCPClient(Actor):
@manage(['address', 'port', 'mode', 'delimiter'])
def init(self, mode="delimiter", delimiter="\r... | true | true |
1c25a9470b01551f157f72664387e5dadd3ea544 | 215 | py | Python | indexing.py | rika77/STEP_coding_camp | 83825759c76295af4b283200d69e04c385151fd9 | [
"MIT"
] | null | null | null | indexing.py | rika77/STEP_coding_camp | 83825759c76295af4b283200d69e04c385151fd9 | [
"MIT"
] | null | null | null | indexing.py | rika77/STEP_coding_camp | 83825759c76295af4b283200d69e04c385151fd9 | [
"MIT"
] | null | null | null | import os
import wp
try:
# 過去のindexは削除する
os.remove("data/index.db")
except OSError:
pass
collection = wp.WikipediaCollection("data/wp.db")
index = wp.Index("data/index.db", collection)
index.generate()
| 17.916667 | 49 | 0.711628 | import os
import wp
try:
os.remove("data/index.db")
except OSError:
pass
collection = wp.WikipediaCollection("data/wp.db")
index = wp.Index("data/index.db", collection)
index.generate()
| true | true |
1c25ab30d024b04fe23f6e0e9fe4b41021ecf3ca | 4,019 | py | Python | uni/settings.py | EricLiclair/testapi | f8a139a0fe4e3ada0256ef62a4603c3e9f682b3e | [
"MIT"
] | 1 | 2021-05-19T18:06:14.000Z | 2021-05-19T18:06:14.000Z | uni/settings.py | EricLiclair/testapi | f8a139a0fe4e3ada0256ef62a4603c3e9f682b3e | [
"MIT"
] | null | null | null | uni/settings.py | EricLiclair/testapi | f8a139a0fe4e3ada0256ef62a4603c3e9f682b3e | [
"MIT"
] | null | null | null | """
Django settings for uni project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import os
from pa... | 24.656442 | 91 | 0.681015 | import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
ALLOWED_HOSTS = ["127.0.0.1", "testmyapi.herokuapp.com"]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.co... | true | true |
1c25ac647d1bb8a52d535dd519a682e606f07996 | 4,093 | py | Python | src/evaluating_rewards/analysis/distances/transformations.py | HumanCompatibleAI/evaluating_rewards | 7b99ec9b415d805bd77041f2f7807d112dec9802 | [
"Apache-2.0"
] | 42 | 2020-04-27T06:54:39.000Z | 2022-02-10T00:59:53.000Z | src/evaluating_rewards/analysis/distances/transformations.py | HumanCompatibleAI/evaluating-rewards | 7b99ec9b415d805bd77041f2f7807d112dec9802 | [
"Apache-2.0"
] | 49 | 2019-11-07T22:01:35.000Z | 2021-02-08T17:27:36.000Z | src/evaluating_rewards/analysis/distances/transformations.py | HumanCompatibleAI/evaluating_rewards | 7b99ec9b415d805bd77041f2f7807d112dec9802 | [
"Apache-2.0"
] | 2 | 2020-10-06T12:17:31.000Z | 2021-06-22T18:03:02.000Z | # Copyright 2019, 2020 DeepMind Technologies Limited, Adam Gleave
#
# 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... | 37.550459 | 100 | 0.658686 |
import re
import pandas as pd
from evaluating_rewards.analysis import results
TRANSFORMATIONS = {
r"^evaluating_rewards[_/](.*)-v0": r"\1",
r"^imitation[_/](.*)-v0": r"\1",
"^Zero": r"\\zeroreward{}",
"^PointMassDense": r"\\dense{}",
"^PointMassGroundTruth": r"\\magnitude{}\\contro... | true | true |
1c25ac8c858a7fa5b5ee02cdf516f5767d244327 | 3,180 | py | Python | adhmodel/simulation/utils.py | erdc/AdhModel | 2c5d49dd4cca484a6c46ded6e1f6dec25db4722c | [
"BSD-3-Clause"
] | 3 | 2019-06-26T13:41:46.000Z | 2019-10-16T02:11:29.000Z | adhmodel/simulation/utils.py | erdc/AdhModel | 2c5d49dd4cca484a6c46ded6e1f6dec25db4722c | [
"BSD-3-Clause"
] | 5 | 2019-06-26T14:29:03.000Z | 2019-07-15T19:25:59.000Z | adhmodel/simulation/utils.py | erdc/AdhModel | 2c5d49dd4cca484a6c46ded6e1f6dec25db4722c | [
"BSD-3-Clause"
] | 2 | 2019-07-26T14:31:14.000Z | 2019-09-03T18:06:39.000Z | from glob import glob
from collections import namedtuple
import logging
log = logging.getLogger('nmutils')
def get_file_list(glob_string=None, file_list=None):
"""Merge a glob and an explicit list of files into one list
Args:
glob_string(str, optional, default=None):
string with wild car... | 30.285714 | 123 | 0.651572 | from glob import glob
from collections import namedtuple
import logging
log = logging.getLogger('nmutils')
def get_file_list(glob_string=None, file_list=None):
file_list = file_list or list()
files = glob(glob_string)
files.extend(file_list)
if len(files) == 0:
raise ValueError('No Files were... | true | true |
1c25ad120d3b6eba149ba6399787274be0488f6c | 4,564 | py | Python | schools3/data/explorers/labels_explorer.py | dssg/mlpolicylab_fall20_schools3_public | f8eff4c56e9bada1eb81ddaca03686d7ef53c2c4 | [
"MIT"
] | null | null | null | schools3/data/explorers/labels_explorer.py | dssg/mlpolicylab_fall20_schools3_public | f8eff4c56e9bada1eb81ddaca03686d7ef53c2c4 | [
"MIT"
] | null | null | null | schools3/data/explorers/labels_explorer.py | dssg/mlpolicylab_fall20_schools3_public | f8eff4c56e9bada1eb81ddaca03686d7ef53c2c4 | [
"MIT"
] | null | null | null | import pandas as pd
from schools3.data.explorers.explorer import Explorer
from schools3.data import common_queries
class LabelsExplorer(Explorer):
def __init__(self, debug=False):
super(LabelsExplorer, self).__init__(debug)
self.labels_df = pd.DataFrame(columns=[
'label',
'... | 40.389381 | 130 | 0.536152 | import pandas as pd
from schools3.data.explorers.explorer import Explorer
from schools3.data import common_queries
class LabelsExplorer(Explorer):
def __init__(self, debug=False):
super(LabelsExplorer, self).__init__(debug)
self.labels_df = pd.DataFrame(columns=[
'label',
'... | true | true |
1c25adfc571ad7fb43c4a6d06df2d9b7fc5fc676 | 386 | py | Python | apps/notifications/management/commands/set_mail_defaults.py | sotkonstantinidis/testcircle | 448aa2148fbc2c969e60f0b33ce112d4740a8861 | [
"Apache-2.0"
] | 3 | 2019-02-24T14:24:43.000Z | 2019-10-24T18:51:32.000Z | apps/notifications/management/commands/set_mail_defaults.py | sotkonstantinidis/testcircle | 448aa2148fbc2c969e60f0b33ce112d4740a8861 | [
"Apache-2.0"
] | 17 | 2017-03-14T10:55:56.000Z | 2022-03-11T23:20:19.000Z | apps/notifications/management/commands/set_mail_defaults.py | sotkonstantinidis/testcircle | 448aa2148fbc2c969e60f0b33ce112d4740a8861 | [
"Apache-2.0"
] | 2 | 2016-02-01T06:32:40.000Z | 2019-09-06T04:33:50.000Z | from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from notifications.models import MailPreferences
class Command(BaseCommand):
"""
Set default mailpreferences for existing users.
"""
def handle(self, **options):
for user in get_user_model().obj... | 27.571429 | 53 | 0.73057 | from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from notifications.models import MailPreferences
class Command(BaseCommand):
def handle(self, **options):
for user in get_user_model().objects.all():
MailPreferences(user=user).set_defaults()
| true | true |
1c25ae4dc23456bb4c195462323ca3c4652c4d6a | 1,143 | py | Python | quantization/lsq/iqnn.py | mlvc-lab/AIChallenge_4th_Round1 | 2a7cd64254540a5779bc3d9accdb21ddaa38aa51 | [
"MIT"
] | 18 | 2020-12-23T06:06:41.000Z | 2020-12-24T04:34:57.000Z | quantization/lsq/iqnn.py | mlvc-lab/AIChallenge_4th_Round1 | 2a7cd64254540a5779bc3d9accdb21ddaa38aa51 | [
"MIT"
] | null | null | null | quantization/lsq/iqnn.py | mlvc-lab/AIChallenge_4th_Round1 | 2a7cd64254540a5779bc3d9accdb21ddaa38aa51 | [
"MIT"
] | null | null | null | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from .quantizer import LSQ
class QuantConv2d(nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, groups=1, bias=True, paddi... | 35.71875 | 103 | 0.682415 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from .quantizer import LSQ
class QuantConv2d(nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, groups=1, bias=True, paddi... | true | true |
1c25ae957bb1e320fe45ec2ef0074989986daba5 | 8,897 | py | Python | query-ext.py | Kaedenn/shell-extension-example | 1e9c9ba227bb9c7d20c7a4022d4630e6c47c05fb | [
"BSD-2-Clause"
] | null | null | null | query-ext.py | Kaedenn/shell-extension-example | 1e9c9ba227bb9c7d20c7a4022d4630e6c47c05fb | [
"BSD-2-Clause"
] | null | null | null | query-ext.py | Kaedenn/shell-extension-example | 1e9c9ba227bb9c7d20c7a4022d4630e6c47c05fb | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
Query an installed extension.
Format configuration (-F, --fconfig): Use -F to specify custom formatting
configuration. The syntax is as follows:
key=<number> Set key to the value of <number>
key Set key to the value True
key=True Set key to the ... | 38.349138 | 99 | 0.604136 |
import argparse
import dbus
import json
import logging
import os
import sys
import time
logging.basicConfig(format="%(module)s:%(lineno)s: %(levelname)s: %(message)s", level=logging.INFO)
logger = logging.getLogger(__name__)
EXT = "example@kaedenn.net"
BUS_OBJ = 'org.gnome.Shell.Extensions'
BUS_PATH = '/org/gnome/... | true | true |
1c25af23bbe0811a90a661b9144762ff44515c43 | 1,243 | py | Python | starthinker/task/dcm_api/schema/dfpSettings.py | quan/starthinker | 4e392415d77affd4a3d91165d1141ab38efd3b8b | [
"Apache-2.0"
] | null | null | null | starthinker/task/dcm_api/schema/dfpSettings.py | quan/starthinker | 4e392415d77affd4a3d91165d1141ab38efd3b8b | [
"Apache-2.0"
] | null | null | null | starthinker/task/dcm_api/schema/dfpSettings.py | quan/starthinker | 4e392415d77affd4a3d91165d1141ab38efd3b8b | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | 29.595238 | 75 | 0.572808 | true | true | |
1c25b08477bfdad95cab185a429ed1a3398642a5 | 553 | py | Python | workbench/test_redirects.py | yoshson/workbench | 701558cac3357cd82e4dc99f0fefed12ee81ddc5 | [
"MIT"
] | 15 | 2020-09-02T22:17:34.000Z | 2022-02-01T20:09:10.000Z | workbench/test_redirects.py | yoshson/workbench | 701558cac3357cd82e4dc99f0fefed12ee81ddc5 | [
"MIT"
] | 18 | 2020-01-08T15:28:26.000Z | 2022-02-28T02:46:41.000Z | workbench/test_redirects.py | yoshson/workbench | 701558cac3357cd82e4dc99f0fefed12ee81ddc5 | [
"MIT"
] | 8 | 2020-09-29T08:00:24.000Z | 2022-01-16T11:58:19.000Z | from django.test import TestCase
from workbench import factories
class RedirectsTest(TestCase):
def test_redirects(self):
"""Root redirects work correctly"""
self.client.force_login(factories.UserFactory.create())
response = self.client.get("/projects/projects/42/")
self.assertRe... | 30.722222 | 86 | 0.687161 | from django.test import TestCase
from workbench import factories
class RedirectsTest(TestCase):
def test_redirects(self):
self.client.force_login(factories.UserFactory.create())
response = self.client.get("/projects/projects/42/")
self.assertRedirects(response, "/projects/42/", fetch_red... | true | true |
1c25b0cca219e77a73a1b111b0c5696e44b348f3 | 1,757 | py | Python | codetools/contexts/tests/function_filter_context_test_case.py | braidedlogix/Codetools_wxPhoenix_py3 | 555e7e3e4895ef9d79716e0323db4445436d10dc | [
"BSD-3-Clause"
] | 1 | 2017-05-12T04:17:50.000Z | 2017-05-12T04:17:50.000Z | codetools/contexts/tests/function_filter_context_test_case.py | braidedlogix/Codetools_wxPhoenix_py3 | 555e7e3e4895ef9d79716e0323db4445436d10dc | [
"BSD-3-Clause"
] | null | null | null | codetools/contexts/tests/function_filter_context_test_case.py | braidedlogix/Codetools_wxPhoenix_py3 | 555e7e3e4895ef9d79716e0323db4445436d10dc | [
"BSD-3-Clause"
] | null | null | null | # Standard library imports
import unittest
# Geo library imports
from codetools.contexts.function_filter_context import FunctionFilterContext
from blockcanvas.debug.my_operator import add, mul, div, sub
class FunctionFilterContextTestCase(unittest.TestCase):
""" Test whether the context filters values by their t... | 35.14 | 80 | 0.531019 |
import unittest
from codetools.contexts.function_filter_context import FunctionFilterContext
from blockcanvas.debug.my_operator import add, mul, div, sub
class FunctionFilterContextTestCase(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
def tearDown(self):
... | true | true |
1c25b17b58b74748ad28e50843f77e13cfc55372 | 3,192 | py | Python | HistogramOfGradients/Basic/Python/hog_evaluate.py | vladiant/ObjectDetectSamples | ac82d0d8284f6fdbcebf1ff429d2aec18cf03fb0 | [
"MIT"
] | null | null | null | HistogramOfGradients/Basic/Python/hog_evaluate.py | vladiant/ObjectDetectSamples | ac82d0d8284f6fdbcebf1ff429d2aec18cf03fb0 | [
"MIT"
] | null | null | null | HistogramOfGradients/Basic/Python/hog_evaluate.py | vladiant/ObjectDetectSamples | ac82d0d8284f6fdbcebf1ff429d2aec18cf03fb0 | [
"MIT"
] | null | null | null | # https://docs.opencv2.org/4.4.0/d1/d73/tutorial_introduction_to_svm.html
import argparse as ap
import cv2
import numpy as np
import os
import joblib
SZ = 20 # Size
bin_n = 16 # Number of bins
affine_flags = cv2.WARP_INVERSE_MAP | cv2.INTER_LINEAR
def imlist(path):
"""
The function imlist returns all the... | 28.5 | 88 | 0.692043 |
import argparse as ap
import cv2
import numpy as np
import os
import joblib
SZ = 20
bin_n = 16
affine_flags = cv2.WARP_INVERSE_MAP | cv2.INTER_LINEAR
def imlist(path):
return [os.path.join(path, f) for f in os.listdir(path)]
def deskew(img):
m = cv2.moments(img)
if abs(m["mu02"]) < 1e-2:
... | true | true |
1c25b189711b7f0bd9238963b4b1951d3ff001b4 | 811 | py | Python | google/ads/google_ads/v6/services/change_status_service_client_config.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v6/services/change_status_service_client_config.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/services/change_status_service_client_config.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | config = {
"interfaces": {
"google.ads.googleads.v6.services.ChangeStatusService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_delay_mi... | 25.34375 | 61 | 0.53021 | config = {
"interfaces": {
"google.ads.googleads.v6.services.ChangeStatusService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_delay_mi... | true | true |
1c25b2ba17889bedab15111f9479f227084e6de4 | 1,794 | py | Python | get_filename/get_filename.py | we684123/get_filename | b1d59873c5a97a3cd1a3b749d93195fe24d3a79d | [
"MIT"
] | null | null | null | get_filename/get_filename.py | we684123/get_filename | b1d59873c5a97a3cd1a3b749d93195fe24d3a79d | [
"MIT"
] | null | null | null | get_filename/get_filename.py | we684123/get_filename | b1d59873c5a97a3cd1a3b749d93195fe24d3a79d | [
"MIT"
] | null | null | null | import warnings
def get_filename(filename=str, mode='filename', index=0):
'''
@param {str} filename (不能為空)
@param {str} mode ('filename' or 'extension') or ( 1 or 2)
@param {int} index (當 mode = 'extension' 或 2 才會作用)
@return {str}
ex1 :
t = get_filename('explosion.hard.txt')
t -> 'ex... | 30.40678 | 63 | 0.528986 | import warnings
def get_filename(filename=str, mode='filename', index=0):
if type(filename) != str:
raise ValueError('filename is not str')
if str(filename) == '':
raise ValueError('filename can not empty')
if (str(mode) == 'filename' or (str(mode) == '1')):
extension = filename.sp... | true | true |
1c25b34e98d6cc281db74aab34b2782d026b27b7 | 135 | py | Python | Team.py | NehaAgarwal2598/Codeforces | 859196a734cb24834736adf9517b351647da6e73 | [
"MIT"
] | null | null | null | Team.py | NehaAgarwal2598/Codeforces | 859196a734cb24834736adf9517b351647da6e73 | [
"MIT"
] | null | null | null | Team.py | NehaAgarwal2598/Codeforces | 859196a734cb24834736adf9517b351647da6e73 | [
"MIT"
] | null | null | null | n = int(input())
sm = 0
for _ in range(n):
a = list(map(int, input().split()))
if sum(a) >= 2:
sm +=1
print(sm)
| 16.875 | 40 | 0.459259 | n = int(input())
sm = 0
for _ in range(n):
a = list(map(int, input().split()))
if sum(a) >= 2:
sm +=1
print(sm)
| true | true |
1c25b3621a5951343edfc4f76c98dc6a37af725e | 1,677 | py | Python | identipy_app/migrations/0011_auto_20180102_2047.py | levitsky/identipy_server | 6dd04d929fadce01eec1ffd800cd3cd17da614b9 | [
"Apache-2.0"
] | null | null | null | identipy_app/migrations/0011_auto_20180102_2047.py | levitsky/identipy_server | 6dd04d929fadce01eec1ffd800cd3cd17da614b9 | [
"Apache-2.0"
] | null | null | null | identipy_app/migrations/0011_auto_20180102_2047.py | levitsky/identipy_server | 6dd04d929fadce01eec1ffd800cd3cd17da614b9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-01-02 17:47
from __future__ import unicode_literals
from django.db import migrations
from django.conf import settings
import os
def rename_dirs(apps, schema_editor):
SearchGroup = apps.get_model('identipy_app', 'SearchGroup')
base = settings.BASE_DI... | 35.680851 | 77 | 0.626714 |
from __future__ import unicode_literals
from django.db import migrations
from django.conf import settings
import os
def rename_dirs(apps, schema_editor):
SearchGroup = apps.get_model('identipy_app', 'SearchGroup')
base = settings.BASE_DIR
for sg in SearchGroup.objects.all():
target = os.path.joi... | true | true |
1c25b36241d77070dd91a131d2ff5e8e15ad4aa9 | 10,568 | py | Python | mayan/apps/converter/classes.py | garrans/mayan-edms | e95e90cc47447a1ae72629271652824aa9868572 | [
"Apache-2.0"
] | null | null | null | mayan/apps/converter/classes.py | garrans/mayan-edms | e95e90cc47447a1ae72629271652824aa9868572 | [
"Apache-2.0"
] | null | null | null | mayan/apps/converter/classes.py | garrans/mayan-edms | e95e90cc47447a1ae72629271652824aa9868572 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import logging
import os
import tempfile
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from PIL import Image
import sh
from django.utils.translation import string_concat, ugettext_lazy as _
from common.settings import setting_t... | 31.735736 | 103 | 0.643263 | from __future__ import unicode_literals
import logging
import os
import tempfile
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from PIL import Image
import sh
from django.utils.translation import string_concat, ugettext_lazy as _
from common.settings import setting_t... | true | true |
1c25b4fb0cc99013f7961720b992fc76685bf299 | 3,370 | py | Python | cmder-box/install.py | coding1618/cmdbox | e3ce411ae078dd198cfbbf3c4d4bc50a624ab674 | [
"Apache-2.0"
] | 1 | 2021-08-25T14:24:17.000Z | 2021-08-25T14:24:17.000Z | cmder-box/install.py | coding1618/cmdbox | e3ce411ae078dd198cfbbf3c4d4bc50a624ab674 | [
"Apache-2.0"
] | null | null | null | cmder-box/install.py | coding1618/cmdbox | e3ce411ae078dd198cfbbf3c4d4bc50a624ab674 | [
"Apache-2.0"
] | null | null | null | # -*- coding=UTF-8-*-
'''
Created on 2018年7月23日12:17:13
cmder-box安装函数
@author: coding1618@gmail.com
'''
import zipfile,os,sys,time,zip,shutil
from winreg import *
#添加环境变量
def add_path(new_dir, scope='user'):
assert scope in ('user', 'system')
if scope == 'user':
key = HKEY_CURRENT_US... | 25.530303 | 82 | 0.544807 |
'''
Created on 2018年7月23日12:17:13
cmder-box安装函数
@author: coding1618@gmail.com
'''
import zipfile,os,sys,time,zip,shutil
from winreg import *
def add_path(new_dir, scope='user'):
assert scope in ('user', 'system')
if scope == 'user':
key = HKEY_CURRENT_USER
subkey = 'Environm... | false | true |
1c25b4fd04cb6d269adff0ae708f10577b929d05 | 6,172 | py | Python | src/java/lang/System.py | bastie/PythonVampire | b5102f7389f3d583c41ec85c574ce5a72bbf4460 | [
"Apache-2.0"
] | 1 | 2020-09-05T14:02:11.000Z | 2020-09-05T14:02:11.000Z | src/java/lang/System.py | bastie/PythonVampire | b5102f7389f3d583c41ec85c574ce5a72bbf4460 | [
"Apache-2.0"
] | null | null | null | src/java/lang/System.py | bastie/PythonVampire | b5102f7389f3d583c41ec85c574ce5a72bbf4460 | [
"Apache-2.0"
] | null | null | null | # SPDX-FileCopyrightText: 2020 - Sebastian Ritter <bastie@users.noreply.github.com>
# SPDX-License-Identifier: Apache-2.0
'''
Created on 01.09.2020
@author: Sͬeͥbͭaͭsͤtͬian
'''
import sys
import os
import platform
import getpass
import locale
import tempfile
from java.lang.Object import Object
from java.python.lang.... | 37.406061 | 83 | 0.621355 |
import sys
import os
import platform
import getpass
import locale
import tempfile
from java.lang.Object import Object
from java.python.lang.ConsoleOutputPrintStream \
import ConsoleOutputPrintStream
from java.util.Properties import Properties
from java.python.lang.IllegalInstantiationException \
import Ill... | true | true |
1c25b52445676c6b35c211dd1cb5d0b4c06154dd | 2,056 | py | Python | loudesttime.py | icr-ctl/gnatcatcher | ddfdde8442a66d2409d16b7eddb769a579460652 | [
"MIT"
] | 1 | 2022-01-08T04:35:48.000Z | 2022-01-08T04:35:48.000Z | loudesttime.py | icr-ctl/gnatcatcher | ddfdde8442a66d2409d16b7eddb769a579460652 | [
"MIT"
] | null | null | null | loudesttime.py | icr-ctl/gnatcatcher | ddfdde8442a66d2409d16b7eddb769a579460652 | [
"MIT"
] | 1 | 2022-01-29T15:42:29.000Z | 2022-01-29T15:42:29.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 8 12:33:57 2021
@author: amandabreton
Gives sample rate, duration, spectrogram and average power of audio.
"""
## import modules
import scipy.io.wavfile
import os
import random
import numpy as np
from numpy import fft as fft
import matplotlib.pyp... | 26.358974 | 71 | 0.714494 |
.wavfile
import os
import random
import numpy as np
from numpy import fft as fft
import matplotlib.pyplot as plt
import argparse
import yaml
import wave
import contextlib
from scipy import fftpack as scfft
from scipy.fft import fft, ifft
from scipy.io.wavfile import write ,read
parser = argparse.ArgumentParser(... | true | true |
1c25b5c07cd59413bf745be2af22d294082d358c | 1,745 | py | Python | src/pylero/externally_linked_work_item.py | leelavg/pylero | f9c6517682cb30d8c99b9574ffb6a53a7494d33a | [
"MIT"
] | 23 | 2020-07-22T07:38:41.000Z | 2022-03-28T11:54:56.000Z | src/pylero/externally_linked_work_item.py | leelavg/pylero | f9c6517682cb30d8c99b9574ffb6a53a7494d33a | [
"MIT"
] | 45 | 2021-02-09T16:37:16.000Z | 2022-03-31T20:39:05.000Z | src/pylero/externally_linked_work_item.py | leelavg/pylero | f9c6517682cb30d8c99b9574ffb6a53a7494d33a | [
"MIT"
] | 26 | 2020-07-22T09:15:31.000Z | 2022-03-29T07:30:01.000Z | # -*- coding: utf8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from pylero.base_polarion import BasePolarion
from pylero.enum_option_id import EnumOptionId
class ExternallyLinkedWorkItem(BasePolarion):
""... | 35.612245 | 77 | 0.692837 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from pylero.base_polarion import BasePolarion
from pylero.enum_option_id import EnumOptionId
class ExternallyLinkedWorkItem(BasePolarion):
_cls_suds_map = {
... | true | true |
1c25b729e37e0180f609ebf79ad73d5df4e03575 | 179 | py | Python | .history/classes/Season_20171106215309.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | .history/classes/Season_20171106215309.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | .history/classes/Season_20171106215309.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | # DADSA - Assignment 1
# Reece Benson
class Season():
rounds = { }
def __init__(self):
print("FUCK YOU!")
def add_round(self, rnd):
print(type(rnd)) | 16.272727 | 29 | 0.569832 |
class Season():
rounds = { }
def __init__(self):
print("FUCK YOU!")
def add_round(self, rnd):
print(type(rnd)) | true | true |
1c25b733e284e967909ea3ebc96dcef4253390e6 | 722 | py | Python | setup.py | ssokolow/PyQt5-fixes | 310e694a3a0293c7484c6b1680451c593d412e2e | [
"MIT"
] | null | null | null | setup.py | ssokolow/PyQt5-fixes | 310e694a3a0293c7484c6b1680451c593d412e2e | [
"MIT"
] | null | null | null | setup.py | ssokolow/PyQt5-fixes | 310e694a3a0293c7484c6b1680451c593d412e2e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name='PyQt5_fixes',
version='0.1.dev1',
description='Workarounds for PyQt5 warts which I find myself using in '
'multiple projects',
author='Stephan Sokolow',
license='MIT',
classifiers=[
'Developm... | 30.083333 | 75 | 0.610803 |
from setuptools import setup, find_packages
setup(
name='PyQt5_fixes',
version='0.1.dev1',
description='Workarounds for PyQt5 warts which I find myself using in '
'multiple projects',
author='Stephan Sokolow',
license='MIT',
classifiers=[
'Development Status :: 3 - Alph... | true | true |
1c25b9052feb2beceec5be3d4252226e8a757075 | 6,098 | py | Python | source/operators/rekognition/start_face_search.py | iandow/aws-media-insights-engine | ae7f4532983a7a2e87990a48e4e21e1c9244d7f9 | [
"Apache-2.0"
] | null | null | null | source/operators/rekognition/start_face_search.py | iandow/aws-media-insights-engine | ae7f4532983a7a2e87990a48e4e21e1c9244d7f9 | [
"Apache-2.0"
] | null | null | null | source/operators/rekognition/start_face_search.py | iandow/aws-media-insights-engine | ae7f4532983a7a2e87990a48e4e21e1c9244d7f9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
###############################################################################
# PURPOSE:
# Lambda function to perform Rekognition tasks on image and video files
#
########################################... | 46.19697 | 122 | 0.672352 | true | true | |
1c25b97f6a62247e8122fd07d8db328bb0156e89 | 1,386 | py | Python | 2020/15/Day15-RambunctiousRecitation.py | zseen/advent-of-code | 0c3f8e8f4d7fd7b7193e417f841ddec6997f265a | [
"MIT"
] | null | null | null | 2020/15/Day15-RambunctiousRecitation.py | zseen/advent-of-code | 0c3f8e8f4d7fd7b7193e417f841ddec6997f265a | [
"MIT"
] | null | null | null | 2020/15/Day15-RambunctiousRecitation.py | zseen/advent-of-code | 0c3f8e8f4d7fd7b7193e417f841ddec6997f265a | [
"MIT"
] | null | null | null | import unittest
from typing import List
from copy import deepcopy
INPUT = [1, 20, 8, 12, 0, 14]
TEST_INPUT = [0, 3, 6]
UPPER_BOUND_FIRST_PART = 2020
UPPER_BOUND_SECOND_PART = 30000000
def getNthNum(initialNums: List[int], upperBound: int):
if not initialNums:
raise ValueError("No initial nums received")... | 27.72 | 80 | 0.7114 | import unittest
from typing import List
from copy import deepcopy
INPUT = [1, 20, 8, 12, 0, 14]
TEST_INPUT = [0, 3, 6]
UPPER_BOUND_FIRST_PART = 2020
UPPER_BOUND_SECOND_PART = 30000000
def getNthNum(initialNums: List[int], upperBound: int):
if not initialNums:
raise ValueError("No initial nums received")... | true | true |
1c25ba4c5282a7dedfb327d5f7ba886635be734a | 1,121 | py | Python | 8_Precvicovanie/8.5_RadCislPokr.py | ViktoriaGallikova/basic-python | 71152f9a1de0e863428e1dd4f4784c129543d015 | [
"MIT"
] | null | null | null | 8_Precvicovanie/8.5_RadCislPokr.py | ViktoriaGallikova/basic-python | 71152f9a1de0e863428e1dd4f4784c129543d015 | [
"MIT"
] | null | null | null | 8_Precvicovanie/8.5_RadCislPokr.py | ViktoriaGallikova/basic-python | 71152f9a1de0e863428e1dd4f4784c129543d015 | [
"MIT"
] | null | null | null | # Radové číslovky - pokračovanie
# Napíšte definíciu funkcie order_numbers, ktorá ako argument prijme zoznam prirodzených čísel, zoradi ich od najväčšieho po najmenší, a vypíše ich na terminál spolu s ich poradím.
from typing import List
def order_numbers(numbers: List[int]) -> None:
"""
>>> order_numbers([10, 5, ... | 23.851064 | 180 | 0.619982 |
from typing import List
def order_numbers(numbers: List[int]) -> None:
zoradenie = sorted(numbers,reverse=True)
for index in range(1,len(zoradenie)):
if index < 20:
if index == 1:
pripona = 'st'
elif index == 2:
pripona = 'nd'
elif index == 3:
pripona = 'rd'
else:
pripona = 'th'
... | true | true |
1c25ba8ab050c1b51074ebbbdfd2cd6bd03996fc | 6,738 | py | Python | ai4water/datasets/utils.py | moonson619/AI4Water-1 | 285d46824502b6a787e42570b72432f4f6acf45e | [
"MIT"
] | 17 | 2021-05-21T13:01:52.000Z | 2022-03-19T15:17:10.000Z | ai4water/datasets/utils.py | moonson619/AI4Water-1 | 285d46824502b6a787e42570b72432f4f6acf45e | [
"MIT"
] | 3 | 2021-10-31T22:40:28.000Z | 2021-11-08T02:28:35.000Z | ai4water/datasets/utils.py | moonson619/AI4Water-1 | 285d46824502b6a787e42570b72432f4f6acf45e | [
"MIT"
] | 7 | 2021-08-06T07:27:50.000Z | 2022-01-26T00:38:32.000Z | import os
import ssl
import tempfile
import sys, shutil
import urllib.request as ulib
import urllib.parse as urlparse
try:
import requests
except ModuleNotFoundError:
requests = None
# following files must exist withing data folder for CAMELS-GB data
DATA_FILES = {
'CAMELS-GB': [
'CAMELS_GB_clim... | 32.868293 | 93 | 0.662956 | import os
import ssl
import tempfile
import sys, shutil
import urllib.request as ulib
import urllib.parse as urlparse
try:
import requests
except ModuleNotFoundError:
requests = None
DATA_FILES = {
'CAMELS-GB': [
'CAMELS_GB_climatic_attributes.csv',
'CAMELS_GB_humaninfluence_attributes.... | true | true |
1c25bac17416cb93a92d429f08d6b1d6f9445af6 | 733 | py | Python | General scrips/List_files_path.py | afcarl/Useful-python | 5d1947052fb25b2388704926e4692511cc162031 | [
"MIT"
] | null | null | null | General scrips/List_files_path.py | afcarl/Useful-python | 5d1947052fb25b2388704926e4692511cc162031 | [
"MIT"
] | null | null | null | General scrips/List_files_path.py | afcarl/Useful-python | 5d1947052fb25b2388704926e4692511cc162031 | [
"MIT"
] | 1 | 2018-09-05T21:48:57.000Z | 2018-09-05T21:48:57.000Z | __author__ = 'Robin Cole'
__version__ = '0.1.0'
"""
Created on Tue Sep 6 10:14:30 2016
http://tkinter.unpythonic.net/wiki/tkFileDialog
"""
import os
try:
# Python 3.x
from tkinter import Tk
from tkinter.filedialog import askdirectory
except ImportError:
# Python 2.x
from Tkinter import Tk
from ... | 25.275862 | 95 | 0.695771 | __author__ = 'Robin Cole'
__version__ = '0.1.0'
import os
try:
from tkinter import Tk
from tkinter.filedialog import askdirectory
except ImportError:
from Tkinter import Tk
from tkFileDialog import askdirectory
root = Tk().withdraw()
my_dir = askdirectory()
print(my_dir)
f = open("fi... | true | true |
1c25bb30e2db5e9438819fc63f48c1e5522aa026 | 1,562 | py | Python | setup.py | aenglander/nwerk | ae8ff835b40be7e331274ccd584fc96e5a8e4a78 | [
"MIT"
] | null | null | null | setup.py | aenglander/nwerk | ae8ff835b40be7e331274ccd584fc96e5a8e4a78 | [
"MIT"
] | 2 | 2018-09-18T03:39:20.000Z | 2018-09-18T03:41:57.000Z | setup.py | aenglander/nwerk | ae8ff835b40be7e331274ccd584fc96e5a8e4a78 | [
"MIT"
] | null | null | null | from distutils.core import setup
from setuptools import find_packages
with open('README.md') as f:
README = f.read()
setup(name='nwerk',
version='0.1.0',
description='The nano web framework for WSGI',
long_description=README,
long_description_content_type='text/markdown; charset=UTF-8',
... | 38.097561 | 72 | 0.601152 | from distutils.core import setup
from setuptools import find_packages
with open('README.md') as f:
README = f.read()
setup(name='nwerk',
version='0.1.0',
description='The nano web framework for WSGI',
long_description=README,
long_description_content_type='text/markdown; charset=UTF-8',
... | true | true |
1c25bbd582437e434f584141cbfef6f63b60b770 | 5,120 | py | Python | asclepias_broker/metadata/models.py | ChiaraBi/asclepias-broker | 793e2634591eed926000b19bd342f044b29bedcc | [
"BSD-3-Clause"
] | null | null | null | asclepias_broker/metadata/models.py | ChiaraBi/asclepias-broker | 793e2634591eed926000b19bd342f044b29bedcc | [
"BSD-3-Clause"
] | null | null | null | asclepias_broker/metadata/models.py | ChiaraBi/asclepias-broker | 793e2634591eed926000b19bd342f044b29bedcc | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018 CERN.
#
# Asclepias Broker is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Metadata database models."""
from copy import deepcopy
import jsonschema
from invenio_db import db
from sqlal... | 33.684211 | 81 | 0.599023 |
from copy import deepcopy
import jsonschema
from invenio_db import db
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm import backref
from sqlalchemy.orm.attributes import flag_modified
from sqlalchemy_utils.models import Timestamp
from sqlalchemy_utils.types import JSONType, UUIDType
from ..grap... | true | true |
1c25bd38f5cef5acaa67a6c676341ff9509c80bf | 13,606 | py | Python | src/lib/reportlab/graphics/renderPDF.py | tschalch/pyTray | ab26c7d4618c16f1ef6df45f7c8bae81f08f855b | [
"BSD-3-Clause"
] | 1 | 2018-06-15T09:42:22.000Z | 2018-06-15T09:42:22.000Z | src/lib/reportlab/graphics/renderPDF.py | tschalch/pyTray | ab26c7d4618c16f1ef6df45f7c8bae81f08f855b | [
"BSD-3-Clause"
] | null | null | null | src/lib/reportlab/graphics/renderPDF.py | tschalch/pyTray | ab26c7d4618c16f1ef6df45f7c8bae81f08f855b | [
"BSD-3-Clause"
] | null | null | null | #Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/renderPDF.py
# renderPDF - draws Drawings onto a canvas
"""Usage:
import renderpdf
renderpdf.draw(drawing, canvas, x, y)
Execut... | 37.585635 | 111 | 0.553285 |
"""Usage:
import renderpdf
renderpdf.draw(drawing, canvas, x, y)
Execute the script to see some test drawings.
changed
"""
__version__=''' $Id: renderPDF.py,v 1.1 2006/05/26 19:19:37 thomas Exp $ '''
from reportlab.graphics.shapes import *
from reportlab.pdfgen.canvas import Canvas
from reportlab... | false | true |
1c25be6a2790091943b304272a099c80077d98fa | 1,692 | py | Python | core/helpers.py | uktrade/directory-sso-dashboard | 6999d5af281aaa1bd4bafa0bf35eb7839ccdef67 | [
"MIT"
] | 10 | 2020-04-30T12:04:35.000Z | 2021-07-21T12:48:55.000Z | core/helpers.py | uktrade/directory-sso-dashboard | 6999d5af281aaa1bd4bafa0bf35eb7839ccdef67 | [
"MIT"
] | 1,461 | 2020-01-23T18:20:26.000Z | 2022-03-31T08:05:56.000Z | core/helpers.py | uktrade/directory-sso-dashboard | 6999d5af281aaa1bd4bafa0bf35eb7839ccdef67 | [
"MIT"
] | 5 | 2019-02-19T11:36:52.000Z | 2020-11-05T12:43:48.000Z | from directory_api_client.client import api_client
from directory_constants import user_roles
from directory_sso_api_client import sso_api_client
def create_user_profile(sso_session_id, data):
profile_response = sso_api_client.user.create_user_profile(sso_session_id=sso_session_id, data=data)
profile_response... | 38.454545 | 104 | 0.789598 | from directory_api_client.client import api_client
from directory_constants import user_roles
from directory_sso_api_client import sso_api_client
def create_user_profile(sso_session_id, data):
profile_response = sso_api_client.user.create_user_profile(sso_session_id=sso_session_id, data=data)
profile_response... | true | true |
1c25bed623eaa17f5628251007a42e668be9f5b6 | 3,664 | py | Python | context_aware_image_captioning/vocabulary.py | geronimocharlie/cognitive_modeling_playground | 8b69764d6167efafa89f99594117ec27a3825448 | [
"MIT"
] | null | null | null | context_aware_image_captioning/vocabulary.py | geronimocharlie/cognitive_modeling_playground | 8b69764d6167efafa89f99594117ec27a3825448 | [
"MIT"
] | null | null | null | context_aware_image_captioning/vocabulary.py | geronimocharlie/cognitive_modeling_playground | 8b69764d6167efafa89f99594117ec27a3825448 | [
"MIT"
] | null | null | null | '''
Vocabulary for the coco dataset.
'''
import nltk
import pickle
import os.path
from pycocotools.coco import COCO
from collections import Counter
class Vocabulary(object):
def __init__(self,
vocab_threshold,
vocab_file="vocab.pkl",
start_word="<start>",
... | 34.242991 | 82 | 0.591157 |
import nltk
import pickle
import os.path
from pycocotools.coco import COCO
from collections import Counter
class Vocabulary(object):
def __init__(self,
vocab_threshold,
vocab_file="vocab.pkl",
start_word="<start>",
end_word="<end>",
... | true | true |
1c25bee0049dae50d2f9904c1aff29c87ed8e893 | 62,231 | py | Python | numpy/core/tests/test_dtype.py | iam-abbas/numpy | 2fb5e969fded3cd468f2ca01d5b954c953545dd9 | [
"BSD-3-Clause"
] | 1 | 2021-10-09T13:24:57.000Z | 2021-10-09T13:24:57.000Z | numpy/core/tests/test_dtype.py | iam-abbas/numpy | 2fb5e969fded3cd468f2ca01d5b954c953545dd9 | [
"BSD-3-Clause"
] | 49 | 2021-09-27T11:16:02.000Z | 2022-03-28T00:37:48.000Z | numpy/core/tests/test_dtype.py | iam-abbas/numpy | 2fb5e969fded3cd468f2ca01d5b954c953545dd9 | [
"BSD-3-Clause"
] | null | null | null | import sys
import operator
import pytest
import ctypes
import gc
import warnings
import types
from typing import Any
import numpy as np
from numpy.core._rational_tests import rational
from numpy.core._multiarray_tests import create_custom_field_dtype
from numpy.testing import (
assert_, assert_equal, assert_array_... | 38.943054 | 96 | 0.51664 | import sys
import operator
import pytest
import ctypes
import gc
import warnings
import types
from typing import Any
import numpy as np
from numpy.core._rational_tests import rational
from numpy.core._multiarray_tests import create_custom_field_dtype
from numpy.testing import (
assert_, assert_equal, assert_array_... | true | true |
1c25c0c605e076b1fdb18290384b81908e6decbe | 206 | py | Python | themer/activators/termite.py | RapiDash1/themer | 06efaa121a79fdb857d497d79093a02a2e12b89c | [
"MIT"
] | 232 | 2016-03-28T15:01:22.000Z | 2022-01-03T16:35:06.000Z | themer/activators/termite.py | RapiDash1/themer | 06efaa121a79fdb857d497d79093a02a2e12b89c | [
"MIT"
] | 45 | 2016-03-20T19:41:36.000Z | 2020-10-01T17:23:52.000Z | themer/activators/termite.py | RapiDash1/themer | 06efaa121a79fdb857d497d79093a02a2e12b89c | [
"MIT"
] | 53 | 2016-03-10T08:15:56.000Z | 2022-03-21T21:41:39.000Z | from themer import ThemeActivator
import os
class TermiteActivator(ThemeActivator):
"""Tell termite to reload configuration file"""
def activate(self):
os.system('killall -s USR1 termite')
| 25.75 | 51 | 0.73301 | from themer import ThemeActivator
import os
class TermiteActivator(ThemeActivator):
def activate(self):
os.system('killall -s USR1 termite')
| true | true |
1c25c0d4f9d65fb43eb3002a1be6336d5217ecf9 | 2,243 | py | Python | python/encrypt.py | githork/PageCrypt | 7e9aae92e330ec9f79696663dfebcb3d3b3f294b | [
"MIT"
] | 228 | 2019-12-03T14:23:18.000Z | 2022-03-25T08:43:51.000Z | python/encrypt.py | githork/PageCrypt | 7e9aae92e330ec9f79696663dfebcb3d3b3f294b | [
"MIT"
] | 22 | 2019-11-26T18:44:43.000Z | 2022-02-12T02:37:05.000Z | python/encrypt.py | githork/PageCrypt | 7e9aae92e330ec9f79696663dfebcb3d3b3f294b | [
"MIT"
] | 65 | 2019-11-26T01:31:06.000Z | 2022-03-19T05:41:44.000Z | #!/usr/bin/python3
try:
from pbkdf2 import PBKDF2
except:
print("install pbkdf2: \"pip3 install pbkdf2\"")
exit(1)
try:
from Crypto import Random
from Crypto.Util.py3compat import bchr
from Crypto.Cipher import AES
except:
print("install pycrypto: \"pip3 install pycrypto\"")
exit(1)
import os, sys
from base64 ... | 28.75641 | 103 | 0.681676 |
try:
from pbkdf2 import PBKDF2
except:
print("install pbkdf2: \"pip3 install pbkdf2\"")
exit(1)
try:
from Crypto import Random
from Crypto.Util.py3compat import bchr
from Crypto.Cipher import AES
except:
print("install pycrypto: \"pip3 install pycrypto\"")
exit(1)
import os, sys
from base64 import b64encode
f... | true | true |
1c25c0e85fef3e3d6c8d3c6509d886b14a957439 | 537 | py | Python | manage.py | tyanakiev/AutoMark | 4e44a9f7c448f02bc4abc05c7a45a67fc71aa3f9 | [
"MIT"
] | 1 | 2018-02-25T06:43:13.000Z | 2018-02-25T06:43:13.000Z | manage.py | tyanakiev/AutoMark | 4e44a9f7c448f02bc4abc05c7a45a67fc71aa3f9 | [
"MIT"
] | 4 | 2021-04-17T03:55:49.000Z | 2022-02-10T10:29:08.000Z | manage.py | tyanakiev/AutoMark | 4e44a9f7c448f02bc4abc05c7a45a67fc71aa3f9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "TryIt.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are yo... | 33.5625 | 73 | 0.685289 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "TryIt.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed... | true | true |
1c25c169bdcb4eaffad5391c37fa4718416081e4 | 763 | py | Python | setup.py | stealthzerocool/firewall | 51bdc37ae475f9ff6eabbf2036516ddbf15e9392 | [
"MIT"
] | 45 | 2015-01-24T10:58:41.000Z | 2022-03-10T15:15:59.000Z | setup.py | stealthzerocool/firewall | 51bdc37ae475f9ff6eabbf2036516ddbf15e9392 | [
"MIT"
] | null | null | null | setup.py | stealthzerocool/firewall | 51bdc37ae475f9ff6eabbf2036516ddbf15e9392 | [
"MIT"
] | 24 | 2015-05-19T02:22:01.000Z | 2022-01-16T06:25:44.000Z | import setuptools
from netkiller import __version__, name, __author__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name=name,
version=__version__,
author=__author__,
author_email="netkiller@msn.com",
description="Netkiller Python firewall",
long_description=long_desc... | 28.259259 | 51 | 0.714286 | import setuptools
from netkiller import __version__, name, __author__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name=name,
version=__version__,
author=__author__,
author_email="netkiller@msn.com",
description="Netkiller Python firewall",
long_description=long_desc... | true | true |
1c25c169e12d84862e38bf71e2c0be4e6dc7da2f | 2,178 | py | Python | packages/python/plotly/plotly/validators/layout/xaxis/_rangeslider.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/xaxis/_rangeslider.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/xaxis/_rangeslider.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class RangesliderValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="rangeslider", parent_name="layout.xaxis", **kwargs):
super(RangesliderValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | 42.705882 | 88 | 0.561983 | import _plotly_utils.basevalidators
class RangesliderValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="rangeslider", parent_name="layout.xaxis", **kwargs):
super(RangesliderValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | true | true |
1c25c20c4b8ea26c972f1c60b4d817c34b506a76 | 873 | py | Python | examples/issue_28/app/models.py | ezeev/Flask-AppBuilder | d95f0ed934272629ee44ad3241646fa7ba09cdf8 | [
"BSD-3-Clause"
] | 71 | 2016-11-02T06:45:42.000Z | 2021-11-15T12:33:48.000Z | examples/issue_28/app/models.py | ezeev/Flask-AppBuilder | d95f0ed934272629ee44ad3241646fa7ba09cdf8 | [
"BSD-3-Clause"
] | 3 | 2021-06-08T23:39:54.000Z | 2022-03-12T00:50:13.000Z | examples/issue_28/app/models.py | ezeev/Flask-AppBuilder | d95f0ed934272629ee44ad3241646fa7ba09cdf8 | [
"BSD-3-Clause"
] | 23 | 2016-11-02T06:45:44.000Z | 2022-02-08T14:55:13.000Z | import datetime
from sqlalchemy import Column, Integer, String, ForeignKey, Date, Float
from sqlalchemy.orm import relationship
from flask_appbuilder.models.mixins import AuditMixin, BaseMixin, FileColumn, ImageColumn
from flask_appbuilder import Model
class Parent(Model):
""" Contains the fields of the deliver... | 28.16129 | 89 | 0.726231 | import datetime
from sqlalchemy import Column, Integer, String, ForeignKey, Date, Float
from sqlalchemy.orm import relationship
from flask_appbuilder.models.mixins import AuditMixin, BaseMixin, FileColumn, ImageColumn
from flask_appbuilder import Model
class Parent(Model):
__tablename__ = 'parent'
id = ... | true | true |
1c25c211d7ad81a4eac2fbf74d806525370a5393 | 3,923 | py | Python | portfolio/Python/scrapy/chat_and_vision/skypeensi.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/chat_and_vision/skypeensi.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/chat_and_vision/skypeensi.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | 5 | 2016-03-22T07:40:46.000Z | 2021-05-30T16:12:21.000Z | try:
import json
except ImportError:
import simplejson as json
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
from product_spiders.items import Product, ProductLoader
import logging
class SkypeEnSiSpider(BaseSpider):
store_ids = {
... | 29.719697 | 102 | 0.523324 | try:
import json
except ImportError:
import simplejson as json
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
from product_spiders.items import Product, ProductLoader
import logging
class SkypeEnSiSpider(BaseSpider):
store_ids = {
... | true | true |
1c25c31829b085a8f3f7f05eee4fb327b6e41f60 | 13,940 | py | Python | evaluation/ablation_models_eval.py | neerajwagh/eeg-self-supervision | fb0a1bf357b0e553aab9c4ccfc2973156dc8a9e7 | [
"MIT"
] | 7 | 2021-11-14T19:58:43.000Z | 2022-03-19T08:35:14.000Z | evaluation/ablation_models_eval.py | neerajwagh/eeg-self-supervision | fb0a1bf357b0e553aab9c4ccfc2973156dc8a9e7 | [
"MIT"
] | null | null | null | evaluation/ablation_models_eval.py | neerajwagh/eeg-self-supervision | fb0a1bf357b0e553aab9c4ccfc2973156dc8a9e7 | [
"MIT"
] | null | null | null | import argparse
import parser
import sys
import numpy as np
import pandas as pd
import torch
from sklearn.metrics import (balanced_accuracy_score, classification_report,
f1_score, precision_score, recall_score,
roc_auc_score, roc_curve)
from torch.utils.data im... | 38.191781 | 182 | 0.717145 | import argparse
import parser
import sys
import numpy as np
import pandas as pd
import torch
from sklearn.metrics import (balanced_accuracy_score, classification_report,
f1_score, precision_score, recall_score,
roc_auc_score, roc_curve)
from torch.utils.data im... | true | true |
1c25c360b38182885826875871ad4a36685d78b0 | 3,355 | py | Python | PythonDemo/paige.py | alanwangmodify/python-learn | f7d720dc1a705b9aafa223e8814cff7ab7e11980 | [
"MIT"
] | 2 | 2019-01-24T15:06:59.000Z | 2019-01-25T07:34:45.000Z | PythonDemo/paige.py | alanwangmodify/python-learn | f7d720dc1a705b9aafa223e8814cff7ab7e11980 | [
"MIT"
] | 1 | 2019-12-23T09:45:11.000Z | 2019-12-23T09:45:11.000Z | PythonDemo/paige.py | alanwangmodify/python-learn | f7d720dc1a705b9aafa223e8814cff7ab7e11980 | [
"MIT"
] | 1 | 2019-07-18T14:21:35.000Z | 2019-07-18T14:21:35.000Z | # coding:utf-8
import turtle as t
t.pensize(4)
t.hideturtle()
t.colormode(255)
t.color((255,155,192),"pink")
t.setup(840,500)
t.speed(10)
#鼻子
t.pu()
t.goto(-100,100)
t.pd()
t.seth(-30)
t.begin_fill()
a=0.4
for i in range(120):
if 0<=i<30 or 60<=i<90:
a=a+0.08
t.lt(3) #向左转3度
t.fd(a) #向前走a的步... | 11.730769 | 36 | 0.592846 |
import turtle as t
t.pensize(4)
t.hideturtle()
t.colormode(255)
t.color((255,155,192),"pink")
t.setup(840,500)
t.speed(10)
t.pu()
t.goto(-100,100)
t.pd()
t.seth(-30)
t.begin_fill()
a=0.4
for i in range(120):
if 0<=i<30 or 60<=i<90:
a=a+0.08
t.lt(3)
t.fd(a)
else:
a=a-0.08
... | true | true |
1c25c4a0eeb3bfac645eacaed81b21e06d96e3a6 | 8,227 | py | Python | houjinname_api_client.py | taka16a23/HoujinBangouAPI | 8ea06ace6ed8367d4a208ea32dcc7a14ad5fca8e | [
"MIT"
] | null | null | null | houjinname_api_client.py | taka16a23/HoujinBangouAPI | 8ea06ace6ed8367d4a208ea32dcc7a14ad5fca8e | [
"MIT"
] | null | null | null | houjinname_api_client.py | taka16a23/HoujinBangouAPI | 8ea06ace6ed8367d4a208ea32dcc7a14ad5fca8e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""houjinname_api_client -- search by campany name for 法人番号API
"""
from datetime import datetime
from .api_client import APIClient
from .address import ADDRESS
from .corporate_type import CORPORATE_TYPE
class HoujinNameAPIClient(APIClient):
"""HoujinNameAPIClient
... | 20.880711 | 73 | 0.537255 |
from datetime import datetime
from .api_client import APIClient
from .address import ADDRESS
from .corporate_type import CORPORATE_TYPE
class HoujinNameAPIClient(APIClient):
class MODE:
PREFIX = "1"
PARTIAL = "2"
class TARGET:
FUZZY = "1"
EXACT = "2"
ENGLIS... | true | true |
1c25c5a553ce730c4f4180627884942d28c5a56a | 6,191 | py | Python | percivaltts/backend_tensorflow.py | gillesdegottex/percival-tts | b0cae5ff4fb58b9bc4964be8da5e5f9566abeec9 | [
"Apache-2.0"
] | 2 | 2018-04-16T12:27:43.000Z | 2019-07-22T18:37:07.000Z | percivaltts/backend_tensorflow.py | gillesdegottex/percival-tts | b0cae5ff4fb58b9bc4964be8da5e5f9566abeec9 | [
"Apache-2.0"
] | 29 | 2018-02-22T14:23:06.000Z | 2018-04-05T14:07:35.000Z | percivaltts/backend_tensorflow.py | gillesdegottex/percival | b0cae5ff4fb58b9bc4964be8da5e5f9566abeec9 | [
"Apache-2.0"
] | 1 | 2018-09-05T03:45:08.000Z | 2018-09-05T03:45:08.000Z | '''
Useful functions related to TensorFlow.
Copyright(C) 2017 Engineering Department, University of Cambridge, UK.
License
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.a... | 36.85119 | 136 | 0.648361 |
import percivaltts
from percivaltts import colored
import os
import re
percivaltts.numpy_force_random_seed()
import tensorflow as tf
tf.set_random_seed(123)
from tensorflow import keras
from keras.layers import Activation
from keras.utils.generic_utils import get_custom_objects
import numpy as np
import tensorf... | true | true |
1c25c5dbaedd6c2708f5d7adbb16ca17df638e2a | 2,379 | py | Python | setup.py | the01/python-flotils | 0923868c6fdd83ecaa9956abd694455e652ccddb | [
"MIT"
] | null | null | null | setup.py | the01/python-flotils | 0923868c6fdd83ecaa9956abd694455e652ccddb | [
"MIT"
] | 25 | 2017-04-03T14:43:11.000Z | 2021-11-08T19:01:15.000Z | setup.py | the01/python-flotils | 0923868c6fdd83ecaa9956abd694455e652ccddb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# from __future__ import unicode_literals
__author__ = "d01 <Florian Jung>"
__email__ = "jungflor@gmail.com"
__copyright__ = "Copyright (C) 2015-16, Florian JUNG"
_... | 27.034091 | 67 | 0.653216 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__author__ = "d01 <Florian Jung>"
__email__ = "jungflor@gmail.com"
__copyright__ = "Copyright (C) 2015-16, Florian JUNG"
__license__ = "MIT"
__version__ = "0.1.2"
__date__ = "2016-04-02"
try:
from setu... | true | true |
1c25c615bb6d9b24077d21a5fd85dc43bc2877f2 | 1,221 | py | Python | src/classifiers/digit/mlp.py | Faudil/sound-encoding-neural-network | daadaddd53881f656b097398b48eac90340132f1 | [
"MIT"
] | null | null | null | src/classifiers/digit/mlp.py | Faudil/sound-encoding-neural-network | daadaddd53881f656b097398b48eac90340132f1 | [
"MIT"
] | null | null | null | src/classifiers/digit/mlp.py | Faudil/sound-encoding-neural-network | daadaddd53881f656b097398b48eac90340132f1 | [
"MIT"
] | null | null | null | import keras
import numpy as np
from keras_preprocessing.sequence import pad_sequences
from keras.layers import Dense, Dropout, Conv1D, Activation, Flatten, MaxPooling1D, BatchNormalization, LSTM
from keras.models import Sequential
from python_speech_features import mfcc
from src.sound.SoundTransformer import SoundTra... | 35.911765 | 108 | 0.709255 | import keras
import numpy as np
from keras_preprocessing.sequence import pad_sequences
from keras.layers import Dense, Dropout, Conv1D, Activation, Flatten, MaxPooling1D, BatchNormalization, LSTM
from keras.models import Sequential
from python_speech_features import mfcc
from src.sound.SoundTransformer import SoundTra... | true | true |
1c25c645a36bbda9b7942dc5dc00f8eeffd732e9 | 345 | py | Python | src/sendemail.py | waynecrasta/UIUC-Course-Hunter | e28caab9da4cde39df808628b75ca016f42d0593 | [
"BSD-2-Clause"
] | 3 | 2016-04-09T07:06:59.000Z | 2017-04-18T02:30:05.000Z | src/sendemail.py | waynecrasta/UIUC-Course-Hunter | e28caab9da4cde39df808628b75ca016f42d0593 | [
"BSD-2-Clause"
] | null | null | null | src/sendemail.py | waynecrasta/UIUC-Course-Hunter | e28caab9da4cde39df808628b75ca016f42d0593 | [
"BSD-2-Clause"
] | 1 | 2021-01-25T19:56:41.000Z | 2021-01-25T19:56:41.000Z | import smtplib
from passwords import details
def sendEmail(message):
sender = details['email']
password = details['password']
recipient = details['recipient']
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(sender, password)
server.sendmail(sender, recipient, me... | 24.642857 | 48 | 0.698551 | import smtplib
from passwords import details
def sendEmail(message):
sender = details['email']
password = details['password']
recipient = details['recipient']
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(sender, password)
server.sendmail(sender, recipient, me... | true | true |
1c25c6950b2116848a55fd9ec60c2348af2d3545 | 8,753 | py | Python | ch03/timing.py | laszlokiraly/LearningAlgorithms | 032a3cc409546619cf41220821d081cde54bbcce | [
"MIT"
] | 74 | 2021-05-06T22:03:18.000Z | 2022-03-25T04:37:51.000Z | ch03/timing.py | laszlokiraly/LearningAlgorithms | 032a3cc409546619cf41220821d081cde54bbcce | [
"MIT"
] | null | null | null | ch03/timing.py | laszlokiraly/LearningAlgorithms | 032a3cc409546619cf41220821d081cde54bbcce | [
"MIT"
] | 19 | 2021-07-16T11:42:00.000Z | 2022-03-22T00:25:49.000Z | """Timing results for chapter 3.
Average search Times with separate chaining hashtables (time in ns)
N 8,192 16,384 32,768 65,536 131,072 262,144 524,288 1,048,576
32 0.481 0.369 0.289 0.264 0.344 0.324 0.315 0.334
6... | 37.088983 | 105 | 0.589169 | import timeit
import random
from resources.english import english_words
from algs.table import DataTable, comma, SKIP
from ch03.perfect.generated_dictionary import perfect_hash, G
def time_results_linked(output=True, decimals=3):
sizes = [8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576]
tbl = Data... | true | true |
1c25c70ed69e0176a16ba1556fe3a994cd06f835 | 7,758 | py | Python | dactyl/dactyl_style_checker.py | ZoydSportello/dactyl | 1dd5289010b63a1d33f0025a522c01396ed8a720 | [
"MIT"
] | null | null | null | dactyl/dactyl_style_checker.py | ZoydSportello/dactyl | 1dd5289010b63a1d33f0025a522c01396ed8a720 | [
"MIT"
] | null | null | null | dactyl/dactyl_style_checker.py | ZoydSportello/dactyl | 1dd5289010b63a1d33f0025a522c01396ed8a720 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
###############################################################################
## Dactyl Style Police ##
## Author: Rome Reginelli ##
## Copyright: Ripple Labs, Inc. 2016 ... | 37.298077 | 93 | 0.552075 | true | true | |
1c25c7d40a7b2042d91f43ae6b989662322a4d04 | 898 | py | Python | tripaille/commands/expression/sync_biomaterials.py | mboudet/python-tripal | c1d0128b16b7c0d3794e217993b053bf0fb64a71 | [
"MIT"
] | 3 | 2017-09-08T15:16:07.000Z | 2019-07-18T12:00:18.000Z | tripaille/commands/expression/sync_biomaterials.py | abretaud/python-tripal | 9988f5a648a40be21d2ae553b2eda91c15fa881e | [
"MIT"
] | 9 | 2018-04-21T14:33:50.000Z | 2019-02-08T09:59:32.000Z | tripaille/commands/expression/sync_biomaterials.py | abretaud/python-tripal | 9988f5a648a40be21d2ae553b2eda91c15fa881e | [
"MIT"
] | 2 | 2018-09-04T13:00:40.000Z | 2018-12-04T14:59:33.000Z | import click
from tripaille.cli import pass_context
from tripaille.decorators import custom_exception, str_output
@click.command('sync_biomaterials')
@click.option(
"--ids",
help="JSON list of ids of biomaterials to be synced (default: all)",
default="[]",
show_default=True,
type=str
)
@click.opti... | 22.45 | 110 | 0.69265 | import click
from tripaille.cli import pass_context
from tripaille.decorators import custom_exception, str_output
@click.command('sync_biomaterials')
@click.option(
"--ids",
help="JSON list of ids of biomaterials to be synced (default: all)",
default="[]",
show_default=True,
type=str
)
@click.opti... | true | true |
1c25c8706771b30e2485470056809112be1fe5c8 | 2,600 | py | Python | django-polls/mysite/polls/views.py | Nakui/Polls | 93ec082016d6a7dbb35686f3f6941a1353a6dc8e | [
"MIT"
] | null | null | null | django-polls/mysite/polls/views.py | Nakui/Polls | 93ec082016d6a7dbb35686f3f6941a1353a6dc8e | [
"MIT"
] | null | null | null | django-polls/mysite/polls/views.py | Nakui/Polls | 93ec082016d6a7dbb35686f3f6941a1353a6dc8e | [
"MIT"
] | null | null | null | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.template import loader
from django.urls import reverse
from django.views import generic
from django.http import Http404
from django.utils import timezone
from .models import Choice, Question
... | 34.210526 | 82 | 0.724231 | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.template import loader
from django.urls import reverse
from django.views import generic
from django.http import Http404
from django.utils import timezone
from .models import Choice, Question
... | true | true |
1c25c950706954e06b8eb2bcd75977ec277e5993 | 197 | py | Python | project_name/users/admin.py | BeDjango/bedjango-starter | 5cf025848b2ad9bfa1ebcd1b4ec9ab4614ccadb9 | [
"MIT"
] | 58 | 2017-03-07T12:09:50.000Z | 2021-02-21T10:10:09.000Z | project_name/users/admin.py | BeDjango/bedjango-starter | 5cf025848b2ad9bfa1ebcd1b4ec9ab4614ccadb9 | [
"MIT"
] | 17 | 2017-03-09T16:13:52.000Z | 2018-02-18T20:55:12.000Z | project_name/users/admin.py | BeDjango/bedjango-starter | 5cf025848b2ad9bfa1ebcd1b4ec9ab4614ccadb9 | [
"MIT"
] | 27 | 2017-03-08T18:59:58.000Z | 2019-07-14T18:54:44.000Z | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
class CustomUserAdmin(UserAdmin):
pass
admin.site.register(User, CustomUserAdmin)
| 16.416667 | 47 | 0.80203 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
class CustomUserAdmin(UserAdmin):
pass
admin.site.register(User, CustomUserAdmin)
| true | true |
1c25c97b5995f4f96a7e24fdbb5e0661914fc97d | 1,184 | py | Python | utils/casperjs_client.py | maomaochonghuang/mo_spider | f3096d4c6faed7a924c43cc25a98a21394763aee | [
"Apache-2.0"
] | null | null | null | utils/casperjs_client.py | maomaochonghuang/mo_spider | f3096d4c6faed7a924c43cc25a98a21394763aee | [
"Apache-2.0"
] | null | null | null | utils/casperjs_client.py | maomaochonghuang/mo_spider | f3096d4c6faed7a924c43cc25a98a21394763aee | [
"Apache-2.0"
] | 1 | 2018-10-02T22:20:58.000Z | 2018-10-02T22:20:58.000Z | #! /usr/bin/env python
#coding=utf8
import urllib
import urllib2
import time
import sys
import common_func
DEFAULT_TIMEOUT = 30
http_header_accpent = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
http_header_language = 'zh-CN,zh;q=0.8'
http_header_cache_control = 'max-age=0'
http_head... | 26.909091 | 160 | 0.722973 |
import urllib
import urllib2
import time
import sys
import common_func
DEFAULT_TIMEOUT = 30
http_header_accpent = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
http_header_language = 'zh-CN,zh;q=0.8'
http_header_cache_control = 'max-age=0'
http_header_pc_ua = 'Mozilla/5.0 (Windows N... | false | true |
1c25c9bd8338683950356756ae65d54276d57082 | 2,346 | py | Python | lib/example/setup.py | NLCharles/trident | 729cc59191e2669e361543975ce37b08043a0c13 | [
"Apache-2.0"
] | null | null | null | lib/example/setup.py | NLCharles/trident | 729cc59191e2669e361543975ce37b08043a0c13 | [
"Apache-2.0"
] | null | null | null | lib/example/setup.py | NLCharles/trident | 729cc59191e2669e361543975ce37b08043a0c13 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import subprocess
from setuptools import find_packages, setup
from setuptools.command.install import install
# TODO: This is a bit buggy since it requires torch before installing torch.
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
WORKDIR = os.path.dirname(os.path.abspath(_... | 30.467532 | 103 | 0.618926 | import os
import sys
import subprocess
from setuptools import find_packages, setup
from setuptools.command.install import install
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
WORKDIR = os.path.dirname(os.path.abspath(__file__))
def get_git_commit_number():
if not os.path.exists('.git'):
... | true | true |
1c25c9e8e5f7c804e084bb255a51fe7047555f44 | 22,951 | py | Python | Lib/site-packages/django/db/backends/oracle/base.py | Lucas11200/LocaPy | 5d1f214c091aa3703b2ff7d3c0713a91ed4a1f48 | [
"bzip2-1.0.6"
] | 42 | 2019-03-01T09:51:13.000Z | 2021-07-22T12:22:49.000Z | Lib/site-packages/django/db/backends/oracle/base.py | Lucas11200/LocaPy | 5d1f214c091aa3703b2ff7d3c0713a91ed4a1f48 | [
"bzip2-1.0.6"
] | 23 | 2019-01-19T08:54:48.000Z | 2022-03-11T23:39:37.000Z | virtual/lib/python3.6/site-packages/django/db/backends/oracle/base.py | eyern/instagram_clone | c18da15b35d28d91c3f63904af9d5da4e8e3e8ae | [
"MIT"
] | 33 | 2019-10-18T17:53:53.000Z | 2022-01-29T23:44:27.000Z | """
Oracle database backend for Django.
Requires cx_Oracle: http://cx-oracle.sourceforge.net/
"""
import datetime
import decimal
import os
import platform
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import utils
from django.db.backends.base.base import BaseD... | 41.957952 | 109 | 0.611346 | import datetime
import decimal
import os
import platform
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import utils
from django.db.backends.base.base import BaseDatabaseWrapper
from django.utils.encoding import force_bytes, force_text
from django.utils.function... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.