hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1714205d11e20956a01b4c33e37e04957551b563 | 2,642 | py | Python | distance_labelling_theorem.py | lucernae/magic-graph-labeling | 562fa2136f90cafc6967df317f19cbda9e6d46fa | [
"MIT"
] | null | null | null | distance_labelling_theorem.py | lucernae/magic-graph-labeling | 562fa2136f90cafc6967df317f19cbda9e6d46fa | [
"MIT"
] | null | null | null | distance_labelling_theorem.py | lucernae/magic-graph-labeling | 562fa2136f90cafc6967df317f19cbda9e6d46fa | [
"MIT"
] | null | null | null | # coding=utf-8
"""
This file will contains criteria for a graph to have distance magic labelling.
"""
from utils import get_logger
logger = get_logger(__name__)
def get_graph_param(graph):
"""
Return graph parameter of r regular constant and n vertices constant
:param graph:
:return: (r, n)
"""
... | 20.48062 | 78 | 0.521196 |
a8b0782dc6d6b0866621e97947d5410cceec3529 | 438 | py | Python | Session 4/Skeleton Files/Exercise 1.py | Descent098/schulich-ignite-winter-2021 | 2003966651f8afc2d75657e1728e8dd8a13b88a2 | [
"MIT"
] | 1 | 2021-02-16T19:44:28.000Z | 2021-02-16T19:44:28.000Z | Session 4/Skeleton Files/Exercise 1.py | Descent098/schulich-ignite-winter-2021 | 2003966651f8afc2d75657e1728e8dd8a13b88a2 | [
"MIT"
] | null | null | null | Session 4/Skeleton Files/Exercise 1.py | Descent098/schulich-ignite-winter-2021 | 2003966651f8afc2d75657e1728e8dd8a13b88a2 | [
"MIT"
] | 1 | 2021-02-22T22:57:19.000Z | 2021-02-22T22:57:19.000Z | """Exercise 1: Meower Power
Remember to fill out all the TODO's, you can quickly scan for them by pressing CTRL/CMD + F
"""
class Animal:
def __init__(self, name, sound):
self.name = name
self.sound = sound
def make_sound(self):
print(self.sound)
class Cat(Animal):
#TODO: finish ... | 18.25 | 91 | 0.605023 |
3fd64f5ba2206fbc3401492a82294d44553a5bec | 1,593 | py | Python | Files/Ch04/02_training_and_saving_weights complete.py | mahdinobar/Image-Recognition-inLearning | 940d5b88f70e65021ea63a4cc71fff9ce231f1a2 | [
"MIT"
] | null | null | null | Files/Ch04/02_training_and_saving_weights complete.py | mahdinobar/Image-Recognition-inLearning | 940d5b88f70e65021ea63a4cc71fff9ce231f1a2 | [
"MIT"
] | 7 | 2019-12-16T22:15:20.000Z | 2022-02-10T00:35:12.000Z | Ex_Files_Deep_Learning_Image_Recog_Upd/Exercise Files/Ch04/02_training_and_saving_weights complete.py | gilson27/learning_experiments | c329b1e0de8dd50afc70fb257540b569927156d1 | [
"MIT"
] | null | null | null | import keras
from keras.datasets import cifar10
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D
from pathlib import Path
# Load data set
(x_train, y_train), (x_test, y_test) = cifar10.load_data()
# Normalize data set to 0-to-1 range
x_train = x_train.astype('... | 25.693548 | 89 | 0.728186 |
b866e1cc4ddc2283ddfd27a4599fddc2b20ea1de | 837 | py | Python | stumpy/jupyter.py | akubera/stumpy | 57539c811022eae437ab0850b20b0ff74bb4e041 | [
"BSD-3-Clause"
] | null | null | null | stumpy/jupyter.py | akubera/stumpy | 57539c811022eae437ab0850b20b0ff74bb4e041 | [
"BSD-3-Clause"
] | null | null | null | stumpy/jupyter.py | akubera/stumpy | 57539c811022eae437ab0850b20b0ff74bb4e041 | [
"BSD-3-Clause"
] | null | null | null | #
# stumpy/jupyter.py
#
"""
Methods for running in a jupyter notebook
"""
from .histogram import Histogram, HistogramRatioPair
from . import utils
import numpy as np
def enable_inline_ROOT_stuff():
from IPython.display import Javascript, display
display(Javascript("""
console.log("enabling JSRoot")
r... | 20.925 | 82 | 0.641577 |
2d83d75c52c07cd0a2e021015587cc5d5f5640ab | 13,866 | py | Python | dxm/lib/masking_api/api/column_metadata_api.py | experiortec/dxm-toolkit | b2ab6189e163c62fa8d7251cd533d2a36430d44a | [
"Apache-2.0"
] | 5 | 2018-08-23T15:47:05.000Z | 2022-01-19T23:38:18.000Z | dxm/lib/masking_api/api/column_metadata_api.py | experiortec/dxm-toolkit | b2ab6189e163c62fa8d7251cd533d2a36430d44a | [
"Apache-2.0"
] | 59 | 2018-10-15T10:37:00.000Z | 2022-03-22T20:49:25.000Z | dxm/lib/masking_api/api/column_metadata_api.py | experiortec/dxm-toolkit | b2ab6189e163c62fa8d7251cd533d2a36430d44a | [
"Apache-2.0"
] | 12 | 2019-03-08T19:59:13.000Z | 2021-12-16T03:28:04.000Z | # coding: utf-8
"""
Masking API
Schema for the Masking Engine API # noqa: E501
OpenAPI spec version: 5.1.8
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import... | 42.018182 | 142 | 0.632338 |
ca1450f7b4b961b44f6f4a1b5ac0e9d1e43592f5 | 6,295 | py | Python | google/cloud/dialogflow_v2/services/conversation_profiles/pagers.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | 171 | 2018-09-19T21:16:18.000Z | 2020-12-07T17:41:10.000Z | google/cloud/dialogflow_v2/services/conversation_profiles/pagers.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | 150 | 2018-09-25T14:04:28.000Z | 2020-12-09T21:45:43.000Z | google/cloud/dialogflow_v2/services/conversation_profiles/pagers.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | 75 | 2018-09-22T14:12:18.000Z | 2020-12-08T07:12:12.000Z | # -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.34375 | 92 | 0.695314 |
1400d052cb8bbdccd5d1848199e5f6417af1451c | 5,034 | py | Python | test/utils/test_conv_transpose.py | sbharadwajj/backpack | 5d484195735e29b1c08848906618f8ba2f339bec | [
"MIT"
] | null | null | null | test/utils/test_conv_transpose.py | sbharadwajj/backpack | 5d484195735e29b1c08848906618f8ba2f339bec | [
"MIT"
] | null | null | null | test/utils/test_conv_transpose.py | sbharadwajj/backpack | 5d484195735e29b1c08848906618f8ba2f339bec | [
"MIT"
] | null | null | null | """Test generalization of unfold to transpose convolutions."""
# TODO: @sbharadwajj: impose test suite structure
# TODO: @sbharadwajj: test with groups≠1
import torch
from backpack.utils.conv_transpose import unfold_by_conv_transpose
from ..automated_test import check_sizes_and_values
torch.manual_seed(0)
#######... | 34.958333 | 87 | 0.638657 |
1b52a9fd38f69a5bd8dec623ce9d6e1ef57a6e46 | 7,835 | py | Python | sdk/python/pulumi_azure_nextgen/cdn/afd_endpoint.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/cdn/afd_endpoint.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/cdn/afd_endpoint.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 41.898396 | 235 | 0.647224 |
92eca6bb896ec3f12fcc0f19178a3c3f31088a2e | 1,568 | py | Python | examples/block_tets_blender.py | franaudo/fea | e164256bac179116520d19d6fc54c98de0610896 | [
"MIT"
] | null | null | null | examples/block_tets_blender.py | franaudo/fea | e164256bac179116520d19d6fc54c98de0610896 | [
"MIT"
] | null | null | null | examples/block_tets_blender.py | franaudo/fea | e164256bac179116520d19d6fc54c98de0610896 | [
"MIT"
] | null | null | null | from compas_fea.cad import blender
from compas_fea.structure import ElasticIsotropic
from compas_fea.structure import ElementProperties as Properties
from compas_fea.structure import GeneralStep
from compas_fea.structure import PinnedDisplacement
from compas_fea.structure import PointLoad
from compas_fea.structure impo... | 23.058824 | 100 | 0.762755 |
d84d2eb662bf916038074299b30c61ad3eb84cc0 | 757 | py | Python | uncommon/uncommon.py | MSAdministrator/uncommon | 2c8e12e1f93cd345331fc8833fa2f8f828f1dff5 | [
"MIT"
] | 1 | 2021-01-10T06:58:01.000Z | 2021-01-10T06:58:01.000Z | uncommon/uncommon.py | MSAdministrator/uncommon | 2c8e12e1f93cd345331fc8833fa2f8f828f1dff5 | [
"MIT"
] | null | null | null | uncommon/uncommon.py | MSAdministrator/uncommon | 2c8e12e1f93cd345331fc8833fa2f8f828f1dff5 | [
"MIT"
] | null | null | null | import os, random
class Uncommon:
__DATA_PATH = os.path.abspath(
os.path.join(
os.path.dirname(__file__), 'data', 'words' + '.txt'
)
)
__word_list = []
def __init__(self, separator='-', count=3):
self.count = count
self.separator = separator
def __loa... | 26.103448 | 65 | 0.574637 |
03f54786bbd38e694ece36d5d81861dd3cb563bb | 579 | py | Python | notebook/re_complie.py | vhn0912/python-snippets | 80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038 | [
"MIT"
] | 174 | 2018-05-30T21:14:50.000Z | 2022-03-25T07:59:37.000Z | notebook/re_complie.py | vhn0912/python-snippets | 80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038 | [
"MIT"
] | 5 | 2019-08-10T03:22:02.000Z | 2021-07-12T20:31:17.000Z | notebook/re_complie.py | vhn0912/python-snippets | 80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038 | [
"MIT"
] | 53 | 2018-04-27T05:26:35.000Z | 2022-03-25T07:59:37.000Z | import re
s = 'aaa@xxx.com, bbb@yyy.com, ccc@zzz.net'
m = re.match(r'([a-z]+)@([a-z]+)\.com', s)
print(m)
# <re.Match object; span=(0, 11), match='aaa@xxx.com'>
result = re.sub(r'([a-z]+)@([a-z]+)\.com', 'new-address', s)
print(result)
# new-address, new-address, ccc@zzz.net
p = re.compile(r'([a-z]+)@([a-z]+)\.com'... | 20.678571 | 60 | 0.580311 |
8c9280d1c3543615eb05e4e88e5e26a20d7d23b7 | 1,240 | py | Python | ant/custom/auto_load/__init__.py | lankors/yunAnt | 2f3ec4e2b7c37a3ed82c8ed836565eea655bfd21 | [
"Apache-2.0"
] | 3 | 2017-08-23T02:55:18.000Z | 2019-12-27T03:43:46.000Z | ant/custom/auto_load/__init__.py | lankors/yunAnt | 2f3ec4e2b7c37a3ed82c8ed836565eea655bfd21 | [
"Apache-2.0"
] | null | null | null | ant/custom/auto_load/__init__.py | lankors/yunAnt | 2f3ec4e2b7c37a3ed82c8ed836565eea655bfd21 | [
"Apache-2.0"
] | 1 | 2020-10-28T10:24:58.000Z | 2020-10-28T10:24:58.000Z | #!/usr/bin/python
#coding=utf-8
"""
auth:wuqichao
mail:wqc2008@gmail.com
createtime:2014-7-10下午2:24:30
usege:
"""
__all__ = ['auto_load']
class auto_load(object):
'''
自动引入模块类
'''
def __init__(self,class_path):
self.class_path = class_path
def import_and_get_mod(self,str... | 21.016949 | 78 | 0.545161 |
8a5c99466963050c7fed025223b4b6cd0274d909 | 496 | py | Python | happier/util.py | williamhogman/happier | 54420e37e20059909fb0d980541af0fa79480337 | [
"MIT"
] | 5 | 2020-06-22T16:13:08.000Z | 2020-06-24T08:43:23.000Z | happier/util.py | williamhogman/happier | 54420e37e20059909fb0d980541af0fa79480337 | [
"MIT"
] | null | null | null | happier/util.py | williamhogman/happier | 54420e37e20059909fb0d980541af0fa79480337 | [
"MIT"
] | null | null | null | import os
import os.path
ROOTS = {
"pyproject.toml",
"requirements.txt",
"Pipfile",
}
def find_root(cwd: str = None, max_jumps: int = 7):
if cwd is None:
return os.getcwd()
if max_jumps == 0:
return None
files = {f for f in os.listdir(cwd) if os.path.isfile(os.path.join(cwd, ... | 19.84 | 80 | 0.600806 |
55685c3dffcba3e6eba6fd2f54170d81c9849737 | 3,930 | py | Python | Python3/wda_functions.py | ChengzijunAixiaoli/POTD | 958e81599a8a4d4396685f3a541cf2d8aa382c16 | [
"Apache-2.0"
] | 3 | 2021-03-20T12:30:15.000Z | 2022-03-01T13:30:33.000Z | Python3/wda_functions.py | ChengzijunAixiaoli/POTD | 958e81599a8a4d4396685f3a541cf2d8aa382c16 | [
"Apache-2.0"
] | null | null | null | Python3/wda_functions.py | ChengzijunAixiaoli/POTD | 958e81599a8a4d4396685f3a541cf2d8aa382c16 | [
"Apache-2.0"
] | 2 | 2021-03-20T12:30:59.000Z | 2021-06-03T16:41:36.000Z | from scipy import linalg
import numpy as np
def pair_tensor(T,x1,x2):
temp=x1[:,None] - x2
C=temp*T[:,:,None]
ans = np.tensordot(C, temp, ([0,1],[0,1]))
return ans
def dist(x1, x2):
""" Compute squared euclidean distance between samples (autograd)
"""
x1p2 = np.sum(np.square(x... | 30.703125 | 87 | 0.516285 |
8d180f1b3f316774f09a7bdf6987d694e1a7fc89 | 7,532 | py | Python | edb/schema/indexes.py | haikyuu/edgedb | 73125882a4eff337692ad10af4bfdf15eef341ab | [
"Apache-2.0"
] | null | null | null | edb/schema/indexes.py | haikyuu/edgedb | 73125882a4eff337692ad10af4bfdf15eef341ab | [
"Apache-2.0"
] | null | null | null | edb/schema/indexes.py | haikyuu/edgedb | 73125882a4eff337692ad10af4bfdf15eef341ab | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 30.995885 | 78 | 0.63675 |
9cdfa8709fa9f37b1552aeb9bb06f33e71a7cc4c | 761 | py | Python | ext/datawald_sqsagency/setup.py | ideabosque/DataWald-AWS | 3ea905a40526dad3cb0eff92167c1e4230aa4aa9 | [
"MIT"
] | null | null | null | ext/datawald_sqsagency/setup.py | ideabosque/DataWald-AWS | 3ea905a40526dad3cb0eff92167c1e4230aa4aa9 | [
"MIT"
] | null | null | null | ext/datawald_sqsagency/setup.py | ideabosque/DataWald-AWS | 3ea905a40526dad3cb0eff92167c1e4230aa4aa9 | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='DataWald-SQSAgency',
version='0.0.2',
author='Idea Bosque',
author_email='ideabosque@gmail.com',
description='DataWald SQSAgency.',
long_description=__doc__,
packages=find_packages(),
include_package_data=True,
zip_safe=False,... | 31.708333 | 86 | 0.660972 |
9be7bca6debb454ec007c51984636a8312491b93 | 11,161 | py | Python | pysdn/controller/topology.py | gaberger/pysdn | 67442e1c259d8ca8620ada95b95977e3852463c5 | [
"BSD-3-Clause"
] | 1 | 2017-08-22T14:17:10.000Z | 2017-08-22T14:17:10.000Z | pysdn/controller/topology.py | gaberger/pysdn | 67442e1c259d8ca8620ada95b95977e3852463c5 | [
"BSD-3-Clause"
] | 1 | 2021-03-26T00:47:22.000Z | 2021-03-26T00:47:22.000Z | pysdn/controller/topology.py | gaberger/pysdn | 67442e1c259d8ca8620ada95b95977e3852463c5 | [
"BSD-3-Clause"
] | null | null | null |
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list... | 30.746556 | 79 | 0.556043 |
808f9d046e37b5450dddcdba43872df20f79809e | 1,680 | py | Python | ariadne/point_net_dev/loss.py | t3hseus/ariadne | b4471a37741000e22281c4d6ff647d65ab9e1914 | [
"MIT"
] | 6 | 2020-08-28T22:44:07.000Z | 2022-01-24T20:53:00.000Z | ariadne/point_net_dev/loss.py | t3hseus/ariadne | b4471a37741000e22281c4d6ff647d65ab9e1914 | [
"MIT"
] | 1 | 2021-02-20T09:38:46.000Z | 2021-02-20T09:38:46.000Z | ariadne/point_net_dev/loss.py | t3hseus/ariadne | b4471a37741000e22281c4d6ff647d65ab9e1914 | [
"MIT"
] | 2 | 2021-10-04T09:25:06.000Z | 2022-02-09T09:09:09.000Z | import gin
import torch
import torch.nn as nn
import torch.nn.functional as F
class PointNetClassificationLoss(nn.Module):
def __init__(self,
real_weight=1,
fake_weight=1,
is_softmax=False,
alpha=0.0001):
super().__init__()
self.r... | 35.744681 | 88 | 0.633929 |
5787fe8f72c935b584a0336f0895d6e1c0d5ee35 | 6,136 | py | Python | s3cache/s3cache.py | bkyryliuk/s3werkzeugcache | 04a99cd4d43de36d936722dfa66d5996b4f6c047 | [
"MIT"
] | 5 | 2017-05-05T00:57:31.000Z | 2021-05-14T13:44:28.000Z | s3cache/s3cache.py | bkyryliuk/s3werkzeugcache | 04a99cd4d43de36d936722dfa66d5996b4f6c047 | [
"MIT"
] | 3 | 2017-11-17T16:35:11.000Z | 2022-01-05T17:23:50.000Z | s3cache/s3cache.py | bkyryliuk/s3werkzeugcache | 04a99cd4d43de36d936722dfa66d5996b4f6c047 | [
"MIT"
] | 7 | 2017-09-21T22:48:23.000Z | 2021-05-14T13:10:50.000Z | """Results backends are used to store long-running query results
The Abstraction is flask-caching, which uses the BaseCache class from cachelib
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
try:
import cPick... | 32.125654 | 120 | 0.566982 |
afbb6fd4d926b871f60e5eca41a0d6ca1e86b933 | 637 | py | Python | configs/xh.deeplab.mobilenet.paris.gt_discriminator/utils/argmax.py | Oliver-ss/Domain_Adaptation | 13e8edc89628f681c383bb2f7297527bbd510f09 | [
"MIT"
] | 6 | 2019-10-24T18:20:33.000Z | 2020-11-11T07:38:44.000Z | configs/xh.deeplab.mobilenet.paris.gt_discriminator/utils/argmax.py | Oliver-ss/Domain_Adaptation | 13e8edc89628f681c383bb2f7297527bbd510f09 | [
"MIT"
] | null | null | null | configs/xh.deeplab.mobilenet.paris.gt_discriminator/utils/argmax.py | Oliver-ss/Domain_Adaptation | 13e8edc89628f681c383bb2f7297527bbd510f09 | [
"MIT"
] | null | null | null | import torch
from torch.autograd import Variable
class ArgMax(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
idx = torch.argmax(input, 1, keepdim=True)
output = torch.zeros_like(input, requires_grad=True)
output.scatter_(1, idx, 1)
return output
@staticmet... | 24.5 | 60 | 0.609105 |
a5dfdb0cd8e9dc21f3ad6581718608a7ec50ce69 | 8,468 | py | Python | test/test_getpy.py | ksob/getpy | 8baa4e1062b94e5ea5a8f6fd07ff3fed98887550 | [
"MIT"
] | 1 | 2019-11-14T13:10:33.000Z | 2019-11-14T13:10:33.000Z | test/test_getpy.py | ksob/getpy | 8baa4e1062b94e5ea5a8f6fd07ff3fed98887550 | [
"MIT"
] | null | null | null | test/test_getpy.py | ksob/getpy | 8baa4e1062b94e5ea5a8f6fd07ff3fed98887550 | [
"MIT"
] | 2 | 2020-06-24T05:58:04.000Z | 2020-08-03T21:22:53.000Z | import pytest
import numpy as np
import getpy as gp
standard = pytest.mark.standard
slow = pytest.mark.slow
@standard
def test_getpy_vectorized_methods():
key_type = np.dtype('u8')
value_type = np.dtype('u8')
gp_dict = gp.Dict(key_type, value_type)
keys = np.random.randint(1, 1000, size=200, dty... | 28.705085 | 111 | 0.650213 |
e98d584594d2bf7d6be3c678356f748e437fa5de | 145 | py | Python | order/admin.py | musojonpython/my_taxi | 3ded68bd4aaba6ee4e91910fc4a0884d3ab56825 | [
"MIT"
] | 2 | 2021-01-25T09:31:43.000Z | 2021-01-25T17:33:19.000Z | order/admin.py | musojonpython/my_taxi | 3ded68bd4aaba6ee4e91910fc4a0884d3ab56825 | [
"MIT"
] | null | null | null | order/admin.py | musojonpython/my_taxi | 3ded68bd4aaba6ee4e91910fc4a0884d3ab56825 | [
"MIT"
] | 1 | 2020-10-06T14:40:28.000Z | 2020-10-06T14:40:28.000Z | from django.contrib import admin
from .models import OrderStatus, AcceptOrder
admin.site.register(OrderStatus)
admin.site.register(AcceptOrder)
| 24.166667 | 44 | 0.841379 |
67575a1b20af35277e0ee12f6a373168cc439f7b | 24,923 | py | Python | termtosvg/anim.py | xqms/termtosvg | 7d96ad4f0ede0ed91fdc3cf3263cb7f16d347959 | [
"BSD-3-Clause"
] | null | null | null | termtosvg/anim.py | xqms/termtosvg | 7d96ad4f0ede0ed91fdc3cf3263cb7f16d347959 | [
"BSD-3-Clause"
] | null | null | null | termtosvg/anim.py | xqms/termtosvg | 7d96ad4f0ede0ed91fdc3cf3263cb7f16d347959 | [
"BSD-3-Clause"
] | null | null | null | import copy
import io
import os.path
import pkgutil
from collections import namedtuple
from itertools import groupby
import pyte.graphics
import pyte.screens
from lxml import etree
from wcwidth import wcswidth
# Ugliest hack: Replace the first 16 colors rgb values by their names so that
# termtosvg can distinguish FG... | 36.922963 | 126 | 0.622919 |
8a51f071f6ced130cf764e9ac3690802a3c992d4 | 532 | py | Python | DAS/data/User.py | sontungtran99/MDAS | 29fd1dbc88dc02b05d561e5b8207a89ba1e648ad | [
"MIT"
] | null | null | null | DAS/data/User.py | sontungtran99/MDAS | 29fd1dbc88dc02b05d561e5b8207a89ba1e648ad | [
"MIT"
] | 8 | 2021-02-08T20:25:38.000Z | 2022-03-11T23:33:03.000Z | DAS/data/User.py | sontungtran99/MDAS | 29fd1dbc88dc02b05d561e5b8207a89ba1e648ad | [
"MIT"
] | null | null | null | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.db'
db = SQLAlchemy(app)
class User(db.Model):
__tablename__ = 'users'
phonenum = db.Column(db.String(15), unique=True, nullable=False, primary_key=True)
district = db.Co... | 25.333333 | 96 | 0.731203 |
3d90783d68030b4e47bd49ed4fdf0d1d8328d79b | 1,174 | py | Python | sktps/ps/aging.py | jclee81/sktacc | 6f601ce8f61b4e361b17773060ee2544bf35dbe4 | [
"Apache-2.0"
] | 2 | 2017-08-03T06:03:25.000Z | 2017-08-10T08:55:22.000Z | sktps/ps/aging.py | jclee81/sktacc | 6f601ce8f61b4e361b17773060ee2544bf35dbe4 | [
"Apache-2.0"
] | 8 | 2020-01-28T21:45:44.000Z | 2022-02-09T23:27:06.000Z | sktps/ps/aging.py | jclee81/sktacc | 6f601ce8f61b4e361b17773060ee2544bf35dbe4 | [
"Apache-2.0"
] | null | null | null | import util
import time
from util.log import log
class DefaultAgingPolicy(object):
def __init__(self, time_out_sec=30):
self.target_iteration_id = -1
self.time_out_sec = time_out_sec
def init(self, parameter_server):
self.target_iteration_id = parameter_server.iteration_id
def ge... | 27.952381 | 76 | 0.560477 |
95f93c251dc3f6a79df82aeba43baeb00601ff1d | 1,701 | py | Python | xlsxwriter/test/core/test_core01.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/core/test_core01.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/core/test_core01.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
import unittest
from io import StringIO
from datetime import datetime
from ..helperfunctions import _xml_to... | 33.352941 | 304 | 0.588477 |
218ffd863f00ab30c289754f17b3b5674e5c82b6 | 24,134 | py | Python | tests/conftest.py | tgisaturday/client | 9c3274cf6035636e0e05ce7e1d869bb2f5e03482 | [
"MIT"
] | 1 | 2020-09-16T19:06:01.000Z | 2020-09-16T19:06:01.000Z | tests/conftest.py | ashzblum/client | 768ca0b40be3bbd58fc7bfe6211c06ca07e1b216 | [
"MIT"
] | 1 | 2021-04-27T20:13:45.000Z | 2021-04-27T20:13:45.000Z | tests/conftest.py | ashzblum/client | 768ca0b40be3bbd58fc7bfe6211c06ca07e1b216 | [
"MIT"
] | null | null | null | from __future__ import print_function
import pytest
import time
import datetime
import requests
import os
import sys
import threading
import logging
import shutil
from contextlib import contextmanager
from tests import utils
from six.moves import queue
from wandb import wandb_sdk
# from multiprocessing import Process... | 28.030197 | 93 | 0.638228 |
29073cc23b1335a67649f59e5b5aeee22ca919ea | 39,852 | py | Python | crabageprediction/venv/Lib/site-packages/pandas/core/groupby/ops.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 3 | 2021-11-23T05:35:28.000Z | 2022-02-10T08:05:53.000Z | crabageprediction/venv/Lib/site-packages/pandas/core/groupby/ops.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 5 | 2022-02-13T14:38:04.000Z | 2022-02-15T00:13:07.000Z | crabageprediction/venv/Lib/site-packages/pandas/core/groupby/ops.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 4 | 2021-11-23T05:36:16.000Z | 2021-11-23T05:39:33.000Z | """
Provide classes to perform the groupby aggregate operations.
These are not exposed to the user and provide implementations of the grouping
operations, primarily in cython. These classes (BaseGrouper and BinGrouper)
are contained *in* the SeriesGroupBy and DataFrameGroupBy objects.
"""
from __future__ import annota... | 31.305577 | 88 | 0.583785 |
25668328a712aa3552345c86503fad46bab46dee | 584 | py | Python | trust-rank/setup.py | allentran/trust-rank | 1c9b351c2ec2ede3128b3c0f6b5ad20fd7433467 | [
"Apache-2.0"
] | 4 | 2015-12-13T16:40:46.000Z | 2019-01-29T09:54:29.000Z | trust-rank/setup.py | allentran/trust-rank | 1c9b351c2ec2ede3128b3c0f6b5ad20fd7433467 | [
"Apache-2.0"
] | null | null | null | trust-rank/setup.py | allentran/trust-rank | 1c9b351c2ec2ede3128b3c0f6b5ad20fd7433467 | [
"Apache-2.0"
] | 7 | 2016-12-27T03:01:44.000Z | 2021-05-04T09:38:01.000Z | from setuptools import setup, find_packages
if __name__ == '__main__':
name = 'trust-finder'
setup(
name = name,
version = "0.0.0",
author = 'Allen Tran',
author_email = 'realallentran@gmail.com',
description = 'Graph based recommender with trust based measures',
packag... | 25.391304 | 71 | 0.583904 |
74dc35f2ef044dd24757e390f37fde932d5285dd | 22,054 | py | Python | test/test_spark_keras.py | Vikas-kum/horovod | 6b77884daf92649ecf031fcc8ff29697bbea0132 | [
"Apache-2.0"
] | 1 | 2019-01-17T16:37:06.000Z | 2019-01-17T16:37:06.000Z | test/test_spark_keras.py | Vikas-kum/horovod | 6b77884daf92649ecf031fcc8ff29697bbea0132 | [
"Apache-2.0"
] | null | null | null | test/test_spark_keras.py | Vikas-kum/horovod | 6b77884daf92649ecf031fcc8ff29697bbea0132 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.17122 | 123 | 0.563617 |
47f42afdaf30ea92c08e78aeba937120b0482b7b | 10,244 | py | Python | models/modules/evolved_modules.py | vuiseng9/CalibTIP | 69077c92611b079234706784c344e8c9156f3283 | [
"MIT"
] | 354 | 2017-02-02T14:28:11.000Z | 2022-03-10T07:37:30.000Z | models/modules/evolved_modules.py | vuiseng9/CalibTIP | 69077c92611b079234706784c344e8c9156f3283 | [
"MIT"
] | 18 | 2017-08-13T02:37:30.000Z | 2021-10-01T03:34:00.000Z | models/modules/evolved_modules.py | vuiseng9/CalibTIP | 69077c92611b079234706784c344e8c9156f3283 | [
"MIT"
] | 97 | 2017-02-05T11:41:42.000Z | 2021-11-25T14:39:56.000Z | """
adapted from https://github.com/quark0/darts
"""
from collections import namedtuple
import torch
import torch.nn as nn
Genotype = namedtuple('Genotype', 'normal normal_concat reduce reduce_concat')
OPS = {
'avg_pool_3x3': lambda channels, stride, affine: nn.AvgPool2d(3, stride=stride, padding=1, cou... | 35.69338 | 137 | 0.513959 |
95d8af7f01e3ff2507103a62c153a9915ea299e3 | 992 | py | Python | examples/load_custom_dataset.py | PGBI/Surprise | 76e47037675afc6c0fb017490a88d1b2b2dff0f7 | [
"BSD-3-Clause"
] | 5,572 | 2016-11-24T08:21:53.000Z | 2022-03-31T20:35:00.000Z | examples/load_custom_dataset.py | daihui-lu/Surprise | 46b9914995e6c8c7d227b46f2eaeef2d4600580f | [
"BSD-3-Clause"
] | 393 | 2016-11-22T12:48:00.000Z | 2022-03-26T15:09:53.000Z | examples/load_custom_dataset.py | daihui-lu/Surprise | 46b9914995e6c8c7d227b46f2eaeef2d4600580f | [
"BSD-3-Clause"
] | 1,096 | 2016-12-08T22:01:57.000Z | 2022-03-29T03:55:54.000Z | """
This module descibes how to load a custom dataset from a single file.
As a custom dataset we will actually use the movielens-100k dataset, but act as
if it were not built-in.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
from surprise i... | 34.206897 | 79 | 0.762097 |
150eb85f9057d2427ac59aeddbf5841e470e19f4 | 12,795 | py | Python | language/mentionmemory/tasks/eae_task.py | greck2908/language | 61fa7260ac7d690d11ef72ca863e45a37c0bdc80 | [
"Apache-2.0"
] | 1,199 | 2018-10-16T01:30:18.000Z | 2022-03-31T21:05:24.000Z | language/mentionmemory/tasks/eae_task.py | greck2908/language | 61fa7260ac7d690d11ef72ca863e45a37c0bdc80 | [
"Apache-2.0"
] | 116 | 2018-10-18T03:31:46.000Z | 2022-03-24T13:40:50.000Z | language/mentionmemory/tasks/eae_task.py | greck2908/language | 61fa7260ac7d690d11ef72ca863e45a37c0bdc80 | [
"Apache-2.0"
] | 303 | 2018-10-22T12:35:12.000Z | 2022-03-27T17:38:17.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 40.362776 | 110 | 0.659789 |
2031e0b5f3a916074ea94a50156353c91e1f6277 | 4,368 | py | Python | am_i_the_asshole/models/classifier.py | mirandrom/am-i-the-asshole | e7e4f00aa193931d45e4012db5cc65d3679faa90 | [
"MIT"
] | 1 | 2020-10-05T16:39:18.000Z | 2020-10-05T16:39:18.000Z | am_i_the_asshole/models/classifier.py | amr-amr/am-i-the-asshole | e7e4f00aa193931d45e4012db5cc65d3679faa90 | [
"MIT"
] | null | null | null | am_i_the_asshole/models/classifier.py | amr-amr/am-i-the-asshole | e7e4f00aa193931d45e4012db5cc65d3679faa90 | [
"MIT"
] | null | null | null | from typing import Dict, Optional
import numpy
from overrides import overrides
import torch
import torch.nn.functional as F
from allennlp.common.checks import ConfigurationError
from allennlp.data import Vocabulary
from allennlp.modules import FeedForward, Seq2VecEncoder, TextFieldEmbedder
from allennlp.models.model ... | 44.121212 | 105 | 0.627747 |
f224ee9ef26bea7eb9be49ccd9da266f020a434d | 1,161 | py | Python | sparkdq/exceptions/TransformExceptions.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | 1 | 2021-02-08T07:49:54.000Z | 2021-02-08T07:49:54.000Z | sparkdq/exceptions/TransformExceptions.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | null | null | null | sparkdq/exceptions/TransformExceptions.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | null | null | null | class TransformException(Exception):
"""
Transform exception happens in the process of transform, can be divided into TransformPreconditionException and
TransformRuntimeException.
"""
@staticmethod
def wrap_if_necessary(exception):
"""
Wrap the exception caught when executing Spa... | 27.642857 | 115 | 0.750215 |
7dd53cf1d299073f29a4f4be0c7b0acba1e3045d | 63 | py | Python | npbench/benchmarks/polybench/atax/atax_numpy.py | frahlg/npbench | 1bc4d9e2e22f3ca67fa2bc7f40e2e751a9c8dd26 | [
"BSD-3-Clause"
] | 27 | 2021-05-10T11:49:13.000Z | 2022-03-22T18:07:19.000Z | npbench/benchmarks/polybench/atax/atax_numpy.py | frahlg/npbench | 1bc4d9e2e22f3ca67fa2bc7f40e2e751a9c8dd26 | [
"BSD-3-Clause"
] | 3 | 2021-12-01T13:03:17.000Z | 2022-03-17T10:53:00.000Z | npbench/benchmarks/polybench/atax/atax_numpy.py | frahlg/npbench | 1bc4d9e2e22f3ca67fa2bc7f40e2e751a9c8dd26 | [
"BSD-3-Clause"
] | 7 | 2021-06-24T03:40:25.000Z | 2022-01-26T09:04:33.000Z | import numpy as np
def kernel(A, x):
return (A @ x) @ A
| 9 | 22 | 0.555556 |
c2140fb08d314aab8a43133d27be7267cefc95e4 | 433 | py | Python | learning/30days/two/2-3-.py | huangjunxiong11/TF2 | 6de61c28c59ef34be7e53762b3a759da152642f7 | [
"MIT"
] | null | null | null | learning/30days/two/2-3-.py | huangjunxiong11/TF2 | 6de61c28c59ef34be7e53762b3a759da152642f7 | [
"MIT"
] | null | null | null | learning/30days/two/2-3-.py | huangjunxiong11/TF2 | 6de61c28c59ef34be7e53762b3a759da152642f7 | [
"MIT"
] | null | null | null | import tensorflow as tf
x = tf.Variable(0.0, name="x", dtype=tf.float32)
optimizer = tf.keras.optimizers.SGD(learning_rate=0.01)
@tf.function
def f():
a = tf.constant(1.0)
b = tf.constant(-2.0)
c = tf.constant(1.0)
y = a * tf.pow(x, 2) + b * x + c
return (y)
@tf.function
def train(epoch):
f... | 17.32 | 55 | 0.600462 |
9e22037918d51196bcdb952f7be203506bdbd5a5 | 472 | py | Python | extragear/choqok/choqok.py | KDE/craft-blueprints-kde | 14932d4b95ce0070ab8ae5669411c62ffa304c9b | [
"BSD-2-Clause"
] | 14 | 2017-09-04T09:01:03.000Z | 2022-01-04T20:09:00.000Z | extragear/choqok/choqok.py | KDE/craft-blueprints-kde | 14932d4b95ce0070ab8ae5669411c62ffa304c9b | [
"BSD-2-Clause"
] | 14 | 2017-12-15T08:11:22.000Z | 2020-12-29T19:11:13.000Z | extragear/choqok/choqok.py | KDE/craft-blueprints-kde | 14932d4b95ce0070ab8ae5669411c62ffa304c9b | [
"BSD-2-Clause"
] | 19 | 2017-09-05T19:16:21.000Z | 2020-10-18T12:46:06.000Z | import info
from Package.CMakePackageBase import *
class subinfo(info.infoclass):
def setTargets(self):
self.svnTargets['svnHEAD'] = 'https://anongit.kde.org/choqok'
self.svnTargets['0.6.0'] = 'tags/choqok/0.6.0/choqok'
self.defaultTarget = 'svnHEAD'
def setDependencies(self):
... | 26.222222 | 69 | 0.688559 |
177e93fc87228c32762a43fb38b518eb58df11be | 14,477 | py | Python | test/py/qa.qa_config_unittest.py | regnauld/ganeti | c1d88461a964a5d0d89cd1ba0571429e01f0a1b5 | [
"BSD-2-Clause"
] | 2 | 2018-09-26T10:09:23.000Z | 2018-09-27T07:27:06.000Z | test/py/qa.qa_config_unittest.py | regnauld/ganeti | c1d88461a964a5d0d89cd1ba0571429e01f0a1b5 | [
"BSD-2-Clause"
] | null | null | null | test/py/qa.qa_config_unittest.py | regnauld/ganeti | c1d88461a964a5d0d89cd1ba0571429e01f0a1b5 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
#
# Copyright (C) 2012, 2013 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this l... | 29.973085 | 76 | 0.665884 |
5c2a0201c4ed658e5fad21bdbe94e8ea9c919163 | 14,584 | py | Python | src/hangar/backends/numpy_10.py | KarenImmanuel/hangar-py | 2a5caff259ad699db56676f14a70cb94e75d8a5b | [
"Apache-2.0"
] | null | null | null | src/hangar/backends/numpy_10.py | KarenImmanuel/hangar-py | 2a5caff259ad699db56676f14a70cb94e75d8a5b | [
"Apache-2.0"
] | null | null | null | src/hangar/backends/numpy_10.py | KarenImmanuel/hangar-py | 2a5caff259ad699db56676f14a70cb94e75d8a5b | [
"Apache-2.0"
] | null | null | null | """Local Numpy memmap Backend Implementation, Identifier: ``NUMPY_10``
Backend Identifiers
===================
* Backend: ``1``
* Version: ``0``
* Format Code: ``10``
* Canonical Name: ``NUMPY_10``
Storage Method
==============
* Data is written to specific subarray indexes inside a numpy memmapped array on dis... | 35.142169 | 99 | 0.597504 |
2d6fd80e87706166893681c054da9a6c90977413 | 896 | py | Python | pathways/views/__init__.py | uw-it-aca/pathways | ad1d136f6e4eab6a4ccc09429d56d3d31a247b27 | [
"Apache-2.0"
] | null | null | null | pathways/views/__init__.py | uw-it-aca/pathways | ad1d136f6e4eab6a4ccc09429d56d3d31a247b27 | [
"Apache-2.0"
] | 148 | 2021-07-12T20:34:57.000Z | 2022-03-11T21:41:33.000Z | pathways/views/__init__.py | uw-it-aca/pathways | ad1d136f6e4eab6a4ccc09429d56d3d31a247b27 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from uw_saml.utils import is_member_of_group
from django.conf import settings
def eval_group_required(group_id):
"""
Similar to ... | 32 | 73 | 0.65067 |
9c8d4eaa984fd481577ffee3dd3a75a5a5c7a9d2 | 1,403 | py | Python | app/core/controllers/base_test.py | abhi1381/foundation-website | 1019c9c9607600b7c124e978d13d66ab781f1282 | [
"Apache-2.0"
] | 9 | 2018-12-31T16:37:29.000Z | 2021-03-07T07:34:23.000Z | app/core/controllers/base_test.py | abhi1381/foundation-website | 1019c9c9607600b7c124e978d13d66ab781f1282 | [
"Apache-2.0"
] | 129 | 2018-07-04T22:01:03.000Z | 2022-03-02T19:14:45.000Z | app/core/controllers/base_test.py | abhi1381/foundation-website | 1019c9c9607600b7c124e978d13d66ab781f1282 | [
"Apache-2.0"
] | 37 | 2018-06-24T18:35:11.000Z | 2021-12-19T09:12:07.000Z | # Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.921053 | 79 | 0.732716 |
7dceb346261b0c6ee4c04433edd78777aac8184b | 54,635 | py | Python | django/db/models/fields/related.py | haroldl/homeworklog | 07f0b1a301091c2d37cbbb7810db267386d4a114 | [
"BSD-3-Clause"
] | 2 | 2020-03-13T15:07:55.000Z | 2020-03-14T14:45:42.000Z | django/db/models/fields/related.py | haroldl/homeworklog | 07f0b1a301091c2d37cbbb7810db267386d4a114 | [
"BSD-3-Clause"
] | null | null | null | django/db/models/fields/related.py | haroldl/homeworklog | 07f0b1a301091c2d37cbbb7810db267386d4a114 | [
"BSD-3-Clause"
] | 1 | 2020-10-16T04:11:58.000Z | 2020-10-16T04:11:58.000Z | from django.conf import settings
from django.db import connection, router, transaction, connections
from django.db.backends import util
from django.db.models import signals, get_model
from django.db.models.fields import (AutoField, Field, IntegerField,
PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotEx... | 46.856775 | 222 | 0.627656 |
83b5061f6116e7a2c54b94d46868d9737baef6b7 | 17,757 | py | Python | qa/rpc-tests/test_framework/util.py | chris-vl/V | 42150e3fb70f4970eaad931855963614ee19e243 | [
"MIT"
] | 1 | 2018-01-19T19:29:29.000Z | 2018-01-19T19:29:29.000Z | qa/rpc-tests/test_framework/util.py | chris-vl/v | 42150e3fb70f4970eaad931855963614ee19e243 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/util.py | chris-vl/v | 42150e3fb70f4970eaad931855963614ee19e243 | [
"MIT"
] | null | null | null | # Copyright (c) 2014-2015 The VCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-vcoinrpc to module search path:
import os
import sys
from decimal impo... | 35.514 | 119 | 0.64414 |
ff8b2d53eb544a8e7cca54b12f5bce76979a843d | 554 | py | Python | util.py | DeDPanda-c/my_first_neuron | 34d837ebf7ed1def3813af2e0d3ee4989d21ae48 | [
"MIT"
] | null | null | null | util.py | DeDPanda-c/my_first_neuron | 34d837ebf7ed1def3813af2e0d3ee4989d21ae48 | [
"MIT"
] | null | null | null | util.py | DeDPanda-c/my_first_neuron | 34d837ebf7ed1def3813af2e0d3ee4989d21ae48 | [
"MIT"
] | null | null | null | import numpy as np
def create_first_matrix(matrix):
if (type(matrix) == np.ndarray and matrix[0] == 1 and matrix[1] == 2 and matrix[2] == 3):
print("SUCCESS")
else:
print("FAILURE")
def my_new_array():
return np.array([[0] * 5, [3] * 5])
def check_random_matrix(a1, a2, a3):
if (a1.... | 26.380952 | 95 | 0.568592 |
1c2e31e4d91019f9a9d7ed49e73b96ac5eae1835 | 1,715 | py | Python | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716225144.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716225144.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716225144.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Decorator Parametors
In the previous ideos we saw some built-in decorators that can handle some arguments:
@wraps(fn) @lru_cache(maxsize=256) <\
def inner(): def factorial(n): \
... ... \>function call
This should loo... | 27.66129 | 89 | 0.542857 |
8e4f878cc76f9af344cc205f8e1bc28cd8e5bd51 | 2,182 | py | Python | chainercv/datasets/transform_dataset.py | iory/chainercv | ecb1953f78c526dfd38308d68a4094c9f4df3a8d | [
"MIT"
] | 1 | 2017-09-04T22:03:03.000Z | 2017-09-04T22:03:03.000Z | chainercv/datasets/transform_dataset.py | iory/chainercv | ecb1953f78c526dfd38308d68a4094c9f4df3a8d | [
"MIT"
] | null | null | null | chainercv/datasets/transform_dataset.py | iory/chainercv | ecb1953f78c526dfd38308d68a4094c9f4df3a8d | [
"MIT"
] | 2 | 2019-12-16T02:20:26.000Z | 2022-01-17T02:00:49.000Z | import warnings
class TransformDataset(object):
"""Dataset that indexes data of a base dataset and transforms it.
This dataset wraps a base dataset by modifying the behavior of the base
dataset's :meth:`__getitem__`. Arrays returned by :meth:`__getitem__` of
the base dataset with an integer index ar... | 35.193548 | 78 | 0.662695 |
e1de5c5ac2ced5208c1dca9804e8dbf2d58f8565 | 22,911 | py | Python | test/functional/test_framework/mininode.py | gingfinger/divi99 | 3b0602b41bf35fb1e30c12b1bf06ef1da58935eb | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | gingfinger/divi99 | 3b0602b41bf35fb1e30c12b1bf06ef1da58935eb | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | gingfinger/divi99 | 3b0602b41bf35fb1e30c12b1bf06ef1da58935eb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2018 The Divi Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Divi P2P networ... | 39.365979 | 182 | 0.645061 |
e8705f9161d7b301844cf1bb70a4fde9c0037a02 | 6,038 | py | Python | cosypose/lib3d/rotations.py | ompugao/cosypose | 4e471c16f19d5ee632668cd52eaa57b562f287d6 | [
"MIT"
] | 202 | 2020-08-19T19:28:03.000Z | 2022-03-29T07:10:47.000Z | cosypose/lib3d/rotations.py | ompugao/cosypose | 4e471c16f19d5ee632668cd52eaa57b562f287d6 | [
"MIT"
] | 66 | 2020-08-24T09:28:05.000Z | 2022-03-31T07:11:06.000Z | cosypose/lib3d/rotations.py | ompugao/cosypose | 4e471c16f19d5ee632668cd52eaa57b562f287d6 | [
"MIT"
] | 66 | 2020-08-19T19:28:05.000Z | 2022-03-18T20:47:55.000Z | import torch
import numpy as np
import transforms3d
def compute_rotation_matrix_from_ortho6d(poses):
"""
Code from https://github.com/papagina/RotationContinuity
On the Continuity of Rotation Representations in Neural Networks
Zhou et al. CVPR19
https://zhouyisjtu.github.io/project_rotation/rotati... | 35.309942 | 77 | 0.626035 |
1125547cc47e6ff6d4c54335b18799b003c9b221 | 9,785 | py | Python | scibotpark/pybullet/robot.py | Shiduo-zh/pybulletSim | a51c71adc328d2071d7faf53e4bc5cd695f03ab2 | [
"MIT"
] | null | null | null | scibotpark/pybullet/robot.py | Shiduo-zh/pybulletSim | a51c71adc328d2071d7faf53e4bc5cd695f03ab2 | [
"MIT"
] | null | null | null | scibotpark/pybullet/robot.py | Shiduo-zh/pybulletSim | a51c71adc328d2071d7faf53e4bc5cd695f03ab2 | [
"MIT"
] | null | null | null | import os
import numpy as np
import pybullet
import pybullet_data as pb_data
from pybullet_utils import bullet_client
class PybulletRobot:
def __init__(self,
default_base_transform= None, # 3-translation + 4-orientation
pb_control_mode= pybullet.POSITION_CONTROL,
pb_control_kwa... | 44.885321 | 155 | 0.625345 |
de70d1e313e569a87cedbca4639e77f789094176 | 25,115 | py | Python | api/core/utility.py | michael-pryor/GeoTweetSearch | cb6d0a7732a0584022f3720e3f696fb709dd45b5 | [
"Apache-2.0"
] | 1 | 2016-04-08T08:40:34.000Z | 2016-04-08T08:40:34.000Z | api/core/utility.py | watfordxp/GeoTweetSearch | cb6d0a7732a0584022f3720e3f696fb709dd45b5 | [
"Apache-2.0"
] | null | null | null | api/core/utility.py | watfordxp/GeoTweetSearch | cb6d0a7732a0584022f3720e3f696fb709dd45b5 | [
"Apache-2.0"
] | 2 | 2015-08-28T17:08:26.000Z | 2016-12-30T21:59:46.000Z | import hashlib
from math import sqrt, ceil, log
from collections import Hashable, OrderedDict, namedtuple, MutableMapping
import copy
import logging
import os
import string
import struct
from threading import RLock, Lock
import unittest
import urllib
import uuid
import time
import sys
__author__ = 'Michael Pryor'
lo... | 25.732582 | 132 | 0.575154 |
4beaadb3622924ea8b1fcc80081ffa679bbfcff2 | 1,155 | py | Python | setup.py | castlabs/pyjip | 947f615d591a940438316e6d21291f730bfcda66 | [
"BSD-3-Clause"
] | null | null | null | setup.py | castlabs/pyjip | 947f615d591a940438316e6d21291f730bfcda66 | [
"BSD-3-Clause"
] | 2 | 2021-03-09T10:35:46.000Z | 2021-03-09T11:02:26.000Z | setup.py | castlabs/pyjip | 947f615d591a940438316e6d21291f730bfcda66 | [
"BSD-3-Clause"
] | null | null | null | try:
from setuptools import setup, Extension
except:
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup, Extension
name = 'pyjip'
version = '0.5'
description = 'JIP pipeline library'
author_email = "thasso.griebel@gmail.com"
url = ""
packages = ['jip', 'jip.cli', ... | 24.574468 | 76 | 0.580087 |
ee7c02465494882ca371df7e6fd343b672bedae7 | 1,835 | py | Python | tests/integration/python_modular/distribution.py | srgnuclear/shogun | 33c04f77a642416376521b0cd1eed29b3256ac13 | [
"Ruby",
"MIT"
] | 1 | 2015-11-05T18:31:14.000Z | 2015-11-05T18:31:14.000Z | tests/integration/python_modular/distribution.py | waderly/shogun | 9288b6fa38e001d63c32188f7f847dadea66e2ae | [
"Ruby",
"MIT"
] | null | null | null | tests/integration/python_modular/distribution.py | waderly/shogun | 9288b6fa38e001d63c32188f7f847dadea66e2ae | [
"Ruby",
"MIT"
] | null | null | null | """
Test Distribution
"""
from numpy import inf, nan
from modshogun import *
import util
def _evaluate (indata):
prefix='distribution_'
feats=util.get_features(indata, prefix)
if indata[prefix+'name']=='HMM':
distribution=HMM(feats['train'], indata[prefix+'N'],
indata[prefix+'M'], indata[prefix+'pseudo'])
... | 29.126984 | 72 | 0.695913 |
0757dbfce312a805a07ddff7db02316a283b8aa5 | 78,112 | py | Python | scicite/resources/lexicons.py | se4en/scicite | 67ed3114f0d0d971a501562e4eaa8d13115a04cc | [
"Apache-2.0"
] | 89 | 2019-04-05T03:13:54.000Z | 2022-03-23T05:21:41.000Z | scicite/resources/lexicons.py | se4en/scicite | 67ed3114f0d0d971a501562e4eaa8d13115a04cc | [
"Apache-2.0"
] | 15 | 2019-04-07T03:01:31.000Z | 2021-09-22T09:09:07.000Z | scicite/resources/lexicons.py | se4en/scicite | 67ed3114f0d0d971a501562e4eaa8d13115a04cc | [
"Apache-2.0"
] | 8 | 2019-04-10T02:05:28.000Z | 2021-08-31T08:33:05.000Z | # Based on (Jurgens et al 2018)
# pylint: disable=line-too-long
# These include manual lexicons defined by Teufel 2006 and Jurgens 2018
# that help identifying the citation intents.
# They also include linguistic patterns and rules that are leveraged as features for the classifier
# From: Jurgens et al. (2018). Measuri... | 70.81777 | 1,671 | 0.510242 |
c07874eef434f5a16ceaec2eea260b2b990ae8c8 | 9,418 | py | Python | chaco/scales/scales_test_case.py | janvonrickenbach/Chaco_wxPhoenix_py3 | 21a10cfd81100f28e3fbc273357ac45642519f33 | [
"BSD-3-Clause"
] | null | null | null | chaco/scales/scales_test_case.py | janvonrickenbach/Chaco_wxPhoenix_py3 | 21a10cfd81100f28e3fbc273357ac45642519f33 | [
"BSD-3-Clause"
] | null | null | null | chaco/scales/scales_test_case.py | janvonrickenbach/Chaco_wxPhoenix_py3 | 21a10cfd81100f28e3fbc273357ac45642519f33 | [
"BSD-3-Clause"
] | null | null | null | from traits.testing.unittest_tools import unittest
from numpy import array
from .formatters import BasicFormatter, OffsetFormatter
from .scales import Pow10Scale, FixedScale, LogScale, DefaultScale, ScaleSystem, frange
class TicksTestCase(unittest.TestCase):
""" Base class for scale and scale system un... | 37.373016 | 88 | 0.510406 |
67595ceff07d293eab94d86319b781fed66c9856 | 1,354 | py | Python | autoio-interfaces/elstruct/reader/_psi4/__init__.py | lpratalimaffei/autoio | 57be6e4882af1841153c19e7353e2531e64ce47f | [
"Apache-2.0"
] | null | null | null | autoio-interfaces/elstruct/reader/_psi4/__init__.py | lpratalimaffei/autoio | 57be6e4882af1841153c19e7353e2531e64ce47f | [
"Apache-2.0"
] | 1 | 2022-02-15T19:35:14.000Z | 2022-02-15T19:35:14.000Z | autoio-interfaces/elstruct/reader/_psi4/__init__.py | lpratalimaffei/autoio | 57be6e4882af1841153c19e7353e2531e64ce47f | [
"Apache-2.0"
] | 13 | 2020-06-24T05:21:11.000Z | 2021-05-05T19:58:30.000Z | """ psi4 output reading module """
from elstruct.reader._psi4.energ import energy
from elstruct.reader._psi4.surface import gradient
from elstruct.reader._psi4.surface import hessian
from elstruct.reader._psi4.surface import harmonic_frequencies
from elstruct.reader._psi4.surface import irc_points
from elstruct.reader.... | 33.85 | 67 | 0.796898 |
8d9ed684ac8ecf9feba491a315963d05508d9dab | 215 | py | Python | nose2_kflag/tests/scenario/doctests/pymodule.py | stefanholek/nose2-kflag | 8236cc43d0f06afabdb401b111af45d5d8fd9a49 | [
"BSD-2-Clause"
] | 1 | 2020-06-14T13:54:15.000Z | 2020-06-14T13:54:15.000Z | nose2_kflag/tests/scenario/doctests/pymodule.py | stefanholek/nose2-kflag | 8236cc43d0f06afabdb401b111af45d5d8fd9a49 | [
"BSD-2-Clause"
] | 1 | 2021-02-02T05:04:05.000Z | 2021-02-02T05:04:05.000Z | nose2_kflag/tests/scenario/doctests/pymodule.py | stefanholek/nose2-kflag | 8236cc43d0f06afabdb401b111af45d5d8fd9a49 | [
"BSD-2-Clause"
] | null | null | null | """
>>> print('foo')
foo
"""
def func_foo():
"""
>>> print('foo')
foo
"""
def func_bar():
"""
>>> print('bar')
bar
"""
def func_baz():
"""
>>> print('baz')
baz
"""
| 9.347826 | 20 | 0.35814 |
136c950caceff332f1066bad1046124a2fcfc2c7 | 1,863 | py | Python | main.py | joaocg/pandas-sqlalchemy-tutorial | 5382ef0159251e7f204c348d843af61bfbfe64b6 | [
"MIT"
] | null | null | null | main.py | joaocg/pandas-sqlalchemy-tutorial | 5382ef0159251e7f204c348d843af61bfbfe64b6 | [
"MIT"
] | null | null | null | main.py | joaocg/pandas-sqlalchemy-tutorial | 5382ef0159251e7f204c348d843af61bfbfe64b6 | [
"MIT"
] | null | null | null | """Main script."""
from os import environ
from sqlalchemy import create_engine
from sqlalchemy.types import Integer, Text, String, DateTime
import pandas as pd
db_URI = engine = 'mysql+pymysql://usuariosfiec:Pll%V!o4J.L3@localhost/cienciadedados'
db_schema = environ.get('SQLALCHEMY_DB_SCHEMA')
engine = create_engine(... | 33.872727 | 86 | 0.56146 |
ed3c1cba7ebcbaead9d6f69eeb8405e81d0aed66 | 466 | py | Python | deepmanagerhelper/__init__.py | matteo-ronchetti/deepmanager-helper | b11f3f3ff5099e1276fd948d83bb6a045fe2e9d3 | [
"MIT"
] | null | null | null | deepmanagerhelper/__init__.py | matteo-ronchetti/deepmanager-helper | b11f3f3ff5099e1276fd948d83bb6a045fe2e9d3 | [
"MIT"
] | null | null | null | deepmanagerhelper/__init__.py | matteo-ronchetti/deepmanager-helper | b11f3f3ff5099e1276fd948d83bb6a045fe2e9d3 | [
"MIT"
] | null | null | null | import os
import json
class DeepManagerHelper:
@staticmethod
def input(path):
return os.path.join("input", path)
@staticmethod
def output(path):
return os.path.join("output", path)
@staticmethod
def _to_json(obj):
try:
return json.dumps(obj)
except... | 19.416667 | 77 | 0.598712 |
ac76f1891cd2e5ad95eb47c834bf37f487cae34e | 7,741 | py | Python | userbot/modules/system_stats.py | itsdzl/Man-Userbot | c247d04d3ee7cd2be334febfd286491ffa07b7be | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-12-23T18:17:44.000Z | 2021-12-23T18:17:44.000Z | userbot/modules/system_stats.py | itsdzl/Man-Userbot | c247d04d3ee7cd2be334febfd286491ffa07b7be | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/system_stats.py | itsdzl/Man-Userbot | c247d04d3ee7cd2be334febfd286491ffa07b7be | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for System Stats commands """
import asyncio
import platform
import sys
import time
from asyncio i... | 33.951754 | 160 | 0.569048 |
4ee02f9bfbe502b851977cc997b2c3e74ebbe7d8 | 62 | py | Python | Python Programs/sum_function.py | manvikri22/hacktoberfest-2021 | 7b169746788835b9dacfdd4e64f3b25f17453178 | [
"MIT"
] | 21 | 2021-10-01T01:52:56.000Z | 2021-11-08T13:01:26.000Z | Python Programs/sum_function.py | manvikri22/hacktoberfest-2021 | 7b169746788835b9dacfdd4e64f3b25f17453178 | [
"MIT"
] | 30 | 2021-09-30T18:28:07.000Z | 2021-10-03T05:23:45.000Z | Python Programs/sum_function.py | manvikri22/hacktoberfest-2021 | 7b169746788835b9dacfdd4e64f3b25f17453178 | [
"MIT"
] | 71 | 2021-09-30T17:32:43.000Z | 2021-10-21T05:26:51.000Z | number = [1, 3, 7, 14]
print(sum(number))
print(sum(number,5)) | 20.666667 | 22 | 0.645161 |
b9ef9ed6c79d74d9d6226bbd313f0ff035af870d | 1,807 | py | Python | code/tests/functional/tests/test_auth.py | CiscoSecurity/tr-05-serverless-google-chronicle | b11c65748eaed7eb424b32c2663b70e71c527c22 | [
"MIT"
] | 1 | 2020-06-19T18:42:40.000Z | 2020-06-19T18:42:40.000Z | code/tests/functional/tests/test_auth.py | CiscoSecurity/tr-05-serverless-google-chronicle | b11c65748eaed7eb424b32c2663b70e71c527c22 | [
"MIT"
] | 1 | 2020-10-15T10:54:37.000Z | 2020-10-15T10:54:37.000Z | code/tests/functional/tests/test_auth.py | CiscoSecurity/tr-05-serverless-google-chronicle | b11c65748eaed7eb424b32c2663b70e71c527c22 | [
"MIT"
] | 1 | 2022-03-04T15:04:28.000Z | 2022-03-04T15:04:28.000Z | import pytest
@pytest.mark.skip('Changed of functionality to get token')
def test_relay_auth_positive(relay_api):
"""Perform testing for relay health endpoint to check
status auth for Google Chronicle
ID: CCTRI-769-0cc7805e-297d-4700-872b-dbf82f267326
Steps:
1. Send request to relay endpoint... | 29.622951 | 75 | 0.653569 |
12026db2a5b9119d26f108c545d94995b4d82ac3 | 3,208 | py | Python | swig/python/osgeo/utils/gdalimport.py | gajgeospatial/gdal-3.2.2 | f03032b8b734f611d5b3039c0e5cdbf81adc306e | [
"Apache-2.0"
] | null | null | null | swig/python/osgeo/utils/gdalimport.py | gajgeospatial/gdal-3.2.2 | f03032b8b734f611d5b3039c0e5cdbf81adc306e | [
"Apache-2.0"
] | null | null | null | swig/python/osgeo/utils/gdalimport.py | gajgeospatial/gdal-3.2.2 | f03032b8b734f611d5b3039c0e5cdbf81adc306e | [
"Apache-2.0"
] | 1 | 2022-02-21T06:31:07.000Z | 2022-02-21T06:31:07.000Z | #!/usr/bin/env python3
# ******************************************************************************
# $Id: gdalimport.py 124baa7f71f15396a661014a81b6c5b0c82c8004 2020-10-14 17:29:39 +0300 Idan Miara $
#
# Name: gdalimport
# Project: GDAL Python Interface
# Purpose: Import a GDAL supported file to Tiled Ge... | 35.644444 | 101 | 0.606608 |
3408885894ff29f524cf6c9733b4a4c7e68cc869 | 3,388 | py | Python | venv/lib/python3.6/site-packages/examples/example_proxied.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 465 | 2016-05-07T00:22:59.000Z | 2022-03-31T08:36:24.000Z | venv/lib/python3.6/site-packages/examples/example_proxied.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 129 | 2016-05-17T08:00:15.000Z | 2022-03-31T23:09:36.000Z | venv/lib/python3.6/site-packages/examples/example_proxied.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 167 | 2016-05-09T16:19:27.000Z | 2022-03-31T07:19:18.000Z | #!/usr/bin/env python
"""Cloudflare API code - example"""
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import CloudFlare
def main():
"""Change the proxied value on a FQDN"""
try:
zone_name = sys.argv[1]
dns_name = sys.argv[2]
if sys.argv[3] == 'false':
n... | 31.082569 | 94 | 0.580283 |
f579c7005daf1276df94752b16cc6ad703cce37f | 686 | py | Python | appengine/standard/mailgun/appengine_config.py | yshalabi/python-docs-samples | 591787c01d94102ba9205f998d95a05b39ccad2f | [
"Apache-2.0"
] | 5,938 | 2015-05-18T05:04:37.000Z | 2022-03-31T20:16:39.000Z | appengine/standard/mailgun/appengine_config.py | yshalabi/python-docs-samples | 591787c01d94102ba9205f998d95a05b39ccad2f | [
"Apache-2.0"
] | 4,730 | 2015-05-07T19:00:38.000Z | 2022-03-31T21:59:41.000Z | appengine/standard/mailgun/appengine_config.py | yshalabi/python-docs-samples | 591787c01d94102ba9205f998d95a05b39ccad2f | [
"Apache-2.0"
] | 6,734 | 2015-05-05T17:06:20.000Z | 2022-03-31T12:02:51.000Z | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.105263 | 74 | 0.760933 |
8a948fa6ef151066597b671d54c697c444eac9f4 | 26,312 | py | Python | vspk/v4_0/nuvm.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | null | null | null | vspk/v4_0/nuvm.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | null | null | null | vspk/v4_0/nuvm.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | 29.934016 | 906 | 0.601285 |
e23ad8f4cb556f0933bd7804bee2ebaf1daaaf13 | 3,616 | py | Python | pyqt5/main.py | Javascript-void0/Java | 37ad42304b1b3a36fcb3a5a2f3171ab20cee9d81 | [
"MIT"
] | null | null | null | pyqt5/main.py | Javascript-void0/Java | 37ad42304b1b3a36fcb3a5a2f3171ab20cee9d81 | [
"MIT"
] | null | null | null | pyqt5/main.py | Javascript-void0/Java | 37ad42304b1b3a36fcb3a5a2f3171ab20cee9d81 | [
"MIT"
] | null | null | null | import PyQt5.QtWidgets as qtw
class MainWindow(qtw.QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle('Calculator')
self.setLayout(qtw.QVBoxLayout())
self.keypad()
self.temp_nums = []
self.fin_nums = []
self.show()
def keypad(self):
... | 44.641975 | 77 | 0.626936 |
320201156ab702e92e713d799650223bbc9cb5e5 | 3,224 | py | Python | data/external/repositories/202553/Grasp-and-Lift-master/carl/nn2/stacknn2.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/202553/Grasp-and-Lift-master/carl/nn2/stacknn2.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/202553/Grasp-and-Lift-master/carl/nn2/stacknn2.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | from xgb_classifier import xgb_classifier
import pandas as pd
import numpy as np
from sklearn.cross_validation import KFold
from sklearn import preprocessing
from collections import Counter
from sklearn import metrics
import h5py
########################################
# this stacking uses the base model vali1_cv.csv... | 27.092437 | 100 | 0.608561 |
7a1463f649ad23cf78fe438bfa94cdabbc25fe46 | 2,297 | py | Python | src/user/models.py | saurabh1e/FlaskStructure | 5291e2c6d994863b7962b07a9fab8b8580405c56 | [
"MIT"
] | 3 | 2016-07-19T14:55:23.000Z | 2022-02-28T03:27:32.000Z | src/user/models.py | saurabh1e/FlaskStructure | 5291e2c6d994863b7962b07a9fab8b8580405c56 | [
"MIT"
] | null | null | null | src/user/models.py | saurabh1e/FlaskStructure | 5291e2c6d994863b7962b07a9fab8b8580405c56 | [
"MIT"
] | null | null | null | from datetime import datetime
from sqlalchemy.ext.hybrid import hybrid_property
from flask_security import RoleMixin, UserMixin
from src import db, BaseMixin, ReprMixin
roles_users = db.Table('roles_users',
db.Column('user_id', db.Integer(), db.ForeignKey('user.id')),
db.C... | 38.283333 | 84 | 0.668263 |
f21ae6b4a504c5a18a9d25124423aedc9a7aff88 | 9,062 | py | Python | examples/pytorch/graphsage/train_sampling.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | null | null | null | examples/pytorch/graphsage/train_sampling.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | null | null | null | examples/pytorch/graphsage/train_sampling.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | null | null | null | import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.multiprocessing as mp
from torch.utils.data import DataLoader
import dgl.function as fn
import dgl.nn.pytorch as dglnn
import time
import argparse
from _thread import start_new... | 37.916318 | 137 | 0.621717 |
20da5bd136e173c2bea7ae2a9f689aecb0d8d23d | 6,529 | py | Python | assignment3/cs231n/simclr/utils.py | shambhu1998/cs231n | cf169f6fea090187787a585c51c624ccd4d9b721 | [
"MIT"
] | null | null | null | assignment3/cs231n/simclr/utils.py | shambhu1998/cs231n | cf169f6fea090187787a585c51c624ccd4d9b721 | [
"MIT"
] | null | null | null | assignment3/cs231n/simclr/utils.py | shambhu1998/cs231n | cf169f6fea090187787a585c51c624ccd4d9b721 | [
"MIT"
] | null | null | null | import pandas as pd
import torch
import torch.optim as optim
from thop import profile, clever_format
from torch.utils.data import DataLoader
from tqdm import tqdm
from .contrastive_loss import *
def train(model, data_loader, train_optimizer, epoch, epochs, batch_size=32, temperature=0.5, device='cuda'):
"""Trains ... | 49.462121 | 129 | 0.566856 |
482a16e6957cf27de79d36d130c6f98523ce4b52 | 557 | py | Python | activity_periods_api/migrations/0004_auto_20200505_1503.py | narendra119/user-activity-api | 74e3ab0d6da668ec9151f9dd70447fc360aef613 | [
"MIT"
] | null | null | null | activity_periods_api/migrations/0004_auto_20200505_1503.py | narendra119/user-activity-api | 74e3ab0d6da668ec9151f9dd70447fc360aef613 | [
"MIT"
] | 10 | 2020-06-05T23:41:31.000Z | 2022-03-12T00:27:36.000Z | activity_periods_api/migrations/0004_auto_20200505_1503.py | narendra119/user-activity-api | 74e3ab0d6da668ec9151f9dd70447fc360aef613 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.2 on 2020-05-05 15:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('activity_periods_api', '0003_auto_20200505_1138'),
]
operations = [
migrations.AlterField(
... | 27.85 | 149 | 0.651706 |
857834e847cf78be9dffde4a474acf237db481a9 | 7,405 | py | Python | src/covid_model_seiir_pipeline/pipeline/diagnostics/task/scatters.py | ihmeuw/covid-model-seiir-pipeline | 9ec71e4156fe47c14379127936c5131636544b0d | [
"BSD-3-Clause"
] | 23 | 2020-05-25T00:20:32.000Z | 2022-01-18T10:32:09.000Z | src/covid_model_seiir_pipeline/pipeline/diagnostics/task/scatters.py | ihmeuw/covid-model-seiir-pipeline | 9ec71e4156fe47c14379127936c5131636544b0d | [
"BSD-3-Clause"
] | 15 | 2020-06-15T16:34:22.000Z | 2021-08-15T22:11:37.000Z | src/covid_model_seiir_pipeline/pipeline/diagnostics/task/scatters.py | ihmeuw/covid-model-seiir-pipeline | 9ec71e4156fe47c14379127936c5131636544b0d | [
"BSD-3-Clause"
] | 11 | 2020-05-24T21:57:29.000Z | 2021-09-07T18:21:15.000Z | from pathlib import Path
import click
import matplotlib.lines as mlines
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
import pandas as pd
import tqdm
from covid_model_seiir_pipeline.lib import (
cli_tools,
static_vars,
)
from covid_model_seiir_pipeline.pipeline.diagnostics.specificat... | 37.025 | 112 | 0.687914 |
7547568bd63236e5b4bb5528659d3389a5835aec | 808 | py | Python | uvicore/contracts/routes-OLD.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 11 | 2021-03-22T22:07:49.000Z | 2022-03-08T16:18:33.000Z | uvicore/contracts/routes-OLD.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 12 | 2021-03-04T05:51:24.000Z | 2021-09-22T05:16:18.000Z | uvicore/contracts/routes-OLD.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 2 | 2021-03-25T14:49:56.000Z | 2021-11-17T23:20:29.000Z | from abc import ABC, abstractmethod
from typing import Any, Dict, Generic, List, TypeVar
from uvicore.contracts import Application, Package
# Generic Router (APIRouter or WebRouter)
R = TypeVar('R')
# class Routes(ABC):
# @abstractmethod
# def register()
# Old direct routeint
# class Routes(Generi... | 17.565217 | 85 | 0.618812 |
bb5e8d8c2d2e0f2d2871ef9712931947e41d37c5 | 1,297 | py | Python | examples/stream/playtoredis(stream)/Blockchain_to_Redis.py | Ucen-Blockchain/streamplay | 3864881d5960fa8915af197ada4bf1225a6742f9 | [
"MIT"
] | null | null | null | examples/stream/playtoredis(stream)/Blockchain_to_Redis.py | Ucen-Blockchain/streamplay | 3864881d5960fa8915af197ada4bf1225a6742f9 | [
"MIT"
] | 4 | 2019-01-30T09:10:30.000Z | 2019-02-01T08:57:52.000Z | examples/stream/playtoredis(stream)/Blockchain_to_Redis.py | Ucen-Blockchain/streamplay | 3864881d5960fa8915af197ada4bf1225a6742f9 | [
"MIT"
] | null | null | null | import ast
import configparser
import os
import sys
from steem.steem import Steemd
from steem.blockchain import Blockchain
from streamplay.db import redisdb
from streamplay.utils import read_config, silence_stdout
def read_config():
""" assuming all values are set properly, missing data etc can be handled
... | 28.195652 | 77 | 0.683886 |
c02340feb81b20a8869932c429878797b2caed62 | 958 | py | Python | Udemy/Secao3/aula57.py | rafaelgama/Curso_Python | 908231de9de4a17f5aa829f2671fd88de9261eda | [
"MIT"
] | 1 | 2020-05-07T20:21:15.000Z | 2020-05-07T20:21:15.000Z | Udemy/Secao3/aula57.py | rafaelgama/Curso_Python | 908231de9de4a17f5aa829f2671fd88de9261eda | [
"MIT"
] | null | null | null | Udemy/Secao3/aula57.py | rafaelgama/Curso_Python | 908231de9de4a17f5aa829f2671fd88de9261eda | [
"MIT"
] | null | null | null | # Sistemas de perguntas e respostas com dicionários Python.
perg = {
'Pergunta 1': {
'pergunta':'Quanto é 2+2?',
'respostas': {'a':'1','b':'4','c':'5',},
'resposta_certa':'b',
},
'Pergunta 2': {
'pergunta':'Quanto é 3+2?',
'respostas': {'a':'4','b':'10','c':'6',},
... | 25.891892 | 59 | 0.553236 |
5affd3850f4784315ddea5be853626b159b0c8f4 | 1,340 | py | Python | business.py | Russian-Dev/TargetFinder2000 | 976dd9dab7cc5319137cfeaac1929438e5ab2636 | [
"Unlicense"
] | null | null | null | business.py | Russian-Dev/TargetFinder2000 | 976dd9dab7cc5319137cfeaac1929438e5ab2636 | [
"Unlicense"
] | null | null | null | business.py | Russian-Dev/TargetFinder2000 | 976dd9dab7cc5319137cfeaac1929438e5ab2636 | [
"Unlicense"
] | null | null | null | import os as o
import json
from urllib.request import urlopen
def osClear():
rOS = p.system()
if rOS in ("Windows", "NT"):
o.system("cls")
else:
o.system("clear")
osClear()
print('____________________________________________________________________')
target = input (" Target IP: ")
print(f'+----------------... | 27.916667 | 80 | 0.518657 |
288a0ec751cbf14713f2e6ac546fcbe9bf991667 | 426 | py | Python | marvin/frontpage/settings.py | programa-stic/marvin-django | 2dfd793f331e18952fc894f5d9cb02f22da6e1ae | [
"BSD-2-Clause"
] | 81 | 2016-02-17T22:48:52.000Z | 2020-12-31T08:57:11.000Z | marvin/frontpage/settings.py | programa-stic/marvin-django | 2dfd793f331e18952fc894f5d9cb02f22da6e1ae | [
"BSD-2-Clause"
] | 1 | 2016-09-08T09:09:31.000Z | 2016-09-08T14:39:50.000Z | marvin/frontpage/settings.py | programa-stic/marvin-django | 2dfd793f331e18952fc894f5d9cb02f22da6e1ae | [
"BSD-2-Clause"
] | 19 | 2016-02-17T23:28:34.000Z | 2022-03-30T18:35:22.000Z | from os import getcwd
root_dir = "/home/foo/marvin-django/marvin"
vuln_analysis_dir = "/home/foo/Marvin-static-Analyzer"
perms_list_file = root_dir + "/frontpage/weka/perms_list_nov2014"
model_file = root_dir + "/frontpage/weka/bayes.model"
root_apk_dir = "/mnt/apks/"
root_git_dir = "/mnt/apks/marvin.git"
gitlab_url = ... | 28.4 | 65 | 0.676056 |
4dccc10dd794cbdb4b05756ef5aa6f64b1def3fb | 5,423 | py | Python | docs/source/conf.py | mristin/icontract-pathlib-poc | e86ee90b63a9ba484ae9295c8de5c60e94624473 | [
"MIT"
] | null | null | null | docs/source/conf.py | mristin/icontract-pathlib-poc | e86ee90b63a9ba484ae9295c8de5c60e94624473 | [
"MIT"
] | null | null | null | docs/source/conf.py | mristin/icontract-pathlib-poc | e86ee90b63a9ba484ae9295c8de5c60e94624473 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.127778 | 84 | 0.65296 |
92de732c00b0eb35a7451f292bd95167bccf4e28 | 4,585 | py | Python | tools/cache_preds.py | tusharc31/c3dpo_nrsfm | bffe61ddd84eb2aab8d6f18c3534107f616d0fd2 | [
"MIT"
] | 310 | 2019-10-08T00:10:45.000Z | 2022-03-30T07:32:22.000Z | tools/cache_preds.py | tusharc31/c3dpo_nrsfm | bffe61ddd84eb2aab8d6f18c3534107f616d0fd2 | [
"MIT"
] | 17 | 2019-10-29T03:34:34.000Z | 2021-05-24T04:21:44.000Z | tools/cache_preds.py | tusharc31/c3dpo_nrsfm | bffe61ddd84eb2aab8d6f18c3534107f616d0fd2 | [
"MIT"
] | 62 | 2019-10-08T00:32:28.000Z | 2022-02-21T23:54:27.000Z | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from torch._six import container_abcs, string_classes, int_classes
import re
import time
import sys
import torch
from tqdm import tqdm
from... | 33.224638 | 79 | 0.631843 |
029e6027503b37145cabdc7f249c382bd5c5d406 | 2,941 | py | Python | utils.py | caiomarinhodev/base_django | 90eae151d4fb45926ad00d4956a7b17ba009fc00 | [
"MIT"
] | null | null | null | utils.py | caiomarinhodev/base_django | 90eae151d4fb45926ad00d4956a7b17ba009fc00 | [
"MIT"
] | 19 | 2018-03-06T13:14:01.000Z | 2019-05-29T01:14:38.000Z | utils.py | caiomarinhodev/base_django | 90eae151d4fb45926ad00d4956a7b17ba009fc00 | [
"MIT"
] | 2 | 2020-11-19T00:54:20.000Z | 2021-02-17T05:43:26.000Z | from django.db.models import (
CharField,
TextField,
IntegerField,
FloatField,
EmailField,
ForeignKey,
FileField,
DateTimeField,
DateField,
AutoField,
BooleanField,
ManyToManyField
)
from django.forms.widgets import (
Textarea,
NumberInput,
EmailInput,
Inp... | 28.278846 | 76 | 0.647399 |
eade42ea8db75ad6fc58d927077ec3448455f241 | 5,268 | py | Python | Simple Wave Analysis/CySmartLogMGMT.py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | Simple Wave Analysis/CySmartLogMGMT.py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | Simple Wave Analysis/CySmartLogMGMT.py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | import os
import os.path
from functools import reduce
Datadir_path = "./data/"
Target_dir_path = "CysmartLogData"
Child_path = "Processed_data/"
Datafile_path = Datadir_path + Target_dir_path + "/"
data_package_eldID = 0
processed_file = ""
def Save_log(argv, argv2, mode = 0):
# print("Save_log = " + argv)
gl... | 41.480315 | 116 | 0.510061 |
e7f8bc13f35b0c18ef7edea991e513feca2b2eb4 | 2,333 | py | Python | examples/kafka/kafka_event_streaming_sink.py | doru1004/rayvens | da89f405586a06b50cc8bb6273d8582400fbca9c | [
"Apache-2.0"
] | 24 | 2021-06-18T21:38:04.000Z | 2022-02-16T19:16:49.000Z | examples/kafka/kafka_event_streaming_sink.py | doru1004/rayvens | da89f405586a06b50cc8bb6273d8582400fbca9c | [
"Apache-2.0"
] | 11 | 2021-06-22T14:36:27.000Z | 2021-12-09T16:33:15.000Z | examples/kafka/kafka_event_streaming_sink.py | doru1004/rayvens | da89f405586a06b50cc8bb6273d8582400fbca9c | [
"Apache-2.0"
] | 5 | 2021-06-18T22:03:55.000Z | 2021-08-02T05:11:46.000Z | #
# Copyright IBM Corporation 2021
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 30.298701 | 78 | 0.705101 |
494994e4708f37e25faf9a190cc33ade49aab08a | 1,996 | py | Python | fortran_da/compute_rmse_wcp.py | lysun0725/MAOOAM | ad0df11876031b8df31bec8171bc4ce5ac2dff9c | [
"MIT"
] | null | null | null | fortran_da/compute_rmse_wcp.py | lysun0725/MAOOAM | ad0df11876031b8df31bec8171bc4ce5ac2dff9c | [
"MIT"
] | null | null | null | fortran_da/compute_rmse_wcp.py | lysun0725/MAOOAM | ad0df11876031b8df31bec8171bc4ce5ac2dff9c | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import sys
ens_num = sys.argv[1]
tw_da = sys.argv[2]
tw_solo = sys.argv[3]
infl = 1.0
wc_file = "Xam_etkf_wcp_%s_%3.1f%s.dat" % (str(ens_num),infl,tw_da)
sp_file = "../../MAOOAM_solo_atm/fortran_da/h%s/Xam_etkf_%s_%3.1f%s.dat" % (tw_solo,str(37),infl,'.1E+00')
sp_file... | 32.721311 | 107 | 0.685872 |
9bad4353a2ed13e6ec264338897381d5e2631ee0 | 1,577 | py | Python | pcat2py/class/213a3774-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/213a3774-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/213a3774-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
################################################################################
# 213a3774-5cc5-11e4-af55-00155d01fe08
#
# Justin Dierking
# justindierking@hardbitsolutions.com
# phnomcobra@gmail.com
#
# 10/24/2014 Original Construction
################################################################... | 41.5 | 182 | 0.633481 |
7899d1de71c37ff196c2dd25995a5aef19b20ec8 | 13,182 | py | Python | processors/ner_span.py | quyuanhang/BERT-NER-Pytorch | 45d2680d61e9e9c00b91811fef1b994542cb5170 | [
"MIT"
] | null | null | null | processors/ner_span.py | quyuanhang/BERT-NER-Pytorch | 45d2680d61e9e9c00b91811fef1b994542cb5170 | [
"MIT"
] | null | null | null | processors/ner_span.py | quyuanhang/BERT-NER-Pytorch | 45d2680d61e9e9c00b91811fef1b994542cb5170 | [
"MIT"
] | null | null | null | """ Named entity recognition fine-tuning: utilities to work with CoNLL-2003 task. """
import torch
import logging
import os
import copy
import json
from .utils_ner import DataProcessor,get_entities
logger = logging.getLogger(__name__)
class InputExample(object):
"""A single training/test example for toke... | 42.798701 | 119 | 0.573433 |
e23a048950c3dbd50742fe558c3318692ef4b9b4 | 8,100 | py | Python | metrics.py | Lopez6969/chromium-dashboard | b35fb5372f33bfe1992c0ffaf1e723afbb3d9af2 | [
"Apache-2.0"
] | null | null | null | metrics.py | Lopez6969/chromium-dashboard | b35fb5372f33bfe1992c0ffaf1e723afbb3d9af2 | [
"Apache-2.0"
] | null | null | null | metrics.py | Lopez6969/chromium-dashboard | b35fb5372f33bfe1992c0ffaf1e723afbb3d9af2 | [
"Apache-2.0"
] | null | null | null | from __future__ import division
from __future__ import print_function
# -*- coding: utf-8 -*-
# Copyright 2013 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.a... | 34.763948 | 83 | 0.728148 |
ac7b1e06c02b7c3175ff4d2f46959c4cb55924c9 | 1,458 | py | Python | zeppelin-jupyter-interpreter/src/main/resources/grpc/jupyter/kernel_client.py | lfrancke/zeppelin | 4fe32f5174f39dc630e08f8f444325e78afe3e1f | [
"Apache-2.0"
] | 1 | 2019-12-20T16:58:08.000Z | 2019-12-20T16:58:08.000Z | zeppelin-jupyter-interpreter/src/main/resources/grpc/jupyter/kernel_client.py | lfrancke/zeppelin | 4fe32f5174f39dc630e08f8f444325e78afe3e1f | [
"Apache-2.0"
] | null | null | null | zeppelin-jupyter-interpreter/src/main/resources/grpc/jupyter/kernel_client.py | lfrancke/zeppelin | 4fe32f5174f39dc630e08f8f444325e78afe3e1f | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 39.405405 | 163 | 0.711248 |
19eee04ce73a133da9668aea353468bc0922378e | 846 | py | Python | tokenizer_hub/__init__.py | Yoctol/tokenizer-hub | 41e8b565d6c2b7b5ab2540da6c68aa19bddaf1fe | [
"MIT"
] | null | null | null | tokenizer_hub/__init__.py | Yoctol/tokenizer-hub | 41e8b565d6c2b7b5ab2540da6c68aa19bddaf1fe | [
"MIT"
] | null | null | null | tokenizer_hub/__init__.py | Yoctol/tokenizer-hub | 41e8b565d6c2b7b5ab2540da6c68aa19bddaf1fe | [
"MIT"
] | null | null | null | from itertools import permutations
int_with_digits = ["_{}int_".format(num) for num in range(1, 13)]
float_with_digits = [
"_{}float{}_".format(pair[0], pair[1]) for pair in list(
permutations(list(range(1, 13)), 2)
) if pair[1] < 5
]
RESERVED_TOKENS = [
"_int_",
"_float_",
"_num_",
] + i... | 32.538462 | 73 | 0.760047 |
c61a773c379ba647f47a3de51dcb3f7ba5e84567 | 101,244 | py | Python | hi_pipeline.py | AMIGA-IAA/hcg_hi_pipeline | de14c6066b06f055cecc3aa89a615ff8c0fd002e | [
"MIT"
] | 1 | 2020-02-20T08:56:48.000Z | 2020-02-20T08:56:48.000Z | hi_pipeline.py | AMIGA-IAA/hcg_hi_pipeline | de14c6066b06f055cecc3aa89a615ff8c0fd002e | [
"MIT"
] | 5 | 2019-12-11T12:02:22.000Z | 2022-03-29T08:46:05.000Z | hi_pipeline.py | AMIGA-IAA/hcg_hi_pipeline | de14c6066b06f055cecc3aa89a615ff8c0fd002e | [
"MIT"
] | 1 | 2022-03-23T13:11:01.000Z | 2022-03-23T13:11:01.000Z | import time
import numpy
import shutil
import readline
import logging
import ConfigParser
from ast import literal_eval
import glob
import collections
# Read configuration file
def read_config(configfile):
'''
Parses the configuration file of parameters passed when the pipeline is executed.
Input:
... | 50.546181 | 896 | 0.601418 |
24029297e02f9993fc89c9ae4a2b404c99d3a086 | 8,671 | py | Python | tests/test_controller.py | itsyosef/READemption | 3e9d950610b025372114fc46219cb43b9ba586e4 | [
"0BSD"
] | 5 | 2020-02-14T14:56:23.000Z | 2021-10-05T09:08:42.000Z | tests/test_controller.py | itsyosef/READemption | 3e9d950610b025372114fc46219cb43b9ba586e4 | [
"0BSD"
] | 22 | 2019-07-16T05:36:53.000Z | 2022-03-28T10:19:29.000Z | tests/test_controller.py | itsyosef/READemption | 3e9d950610b025372114fc46219cb43b9ba586e4 | [
"0BSD"
] | 7 | 2020-04-10T02:48:30.000Z | 2021-11-14T01:25:17.000Z | import os
import sys
import unittest
import shutil
sys.path.append(".")
from reademptionlib.controller import Controller
class ArgMock(object):
project_path = "a_test_project"
min_read_length = 12
segemehl_bin = "segemehl.x"
threads = 1
segemehl_accuracy = 95
segemehl_evalue = 5.0
paired_... | 38.367257 | 118 | 0.770038 |
3874bda6c5841b3afe3b384f2c7bfdb1d011ff4d | 1,354 | py | Python | aliyun-python-sdk-cr/aliyunsdkcr/request/v20160607/GetNamespaceListRequest.py | LittleJober/aliyun-openapi-python-sdk | f45cfa2248a5c8c47b2cebc1d4d1c2516b94df76 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cr/aliyunsdkcr/request/v20160607/GetNamespaceListRequest.py | LittleJober/aliyun-openapi-python-sdk | f45cfa2248a5c8c47b2cebc1d4d1c2516b94df76 | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-cr/aliyunsdkcr/request/v20160607/GetNamespaceListRequest.py | LittleJober/aliyun-openapi-python-sdk | f45cfa2248a5c8c47b2cebc1d4d1c2516b94df76 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.717949 | 74 | 0.757755 |
4808121bdf7ca87dc687fb84e66a6c4bdb8c32ee | 4,421 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/topology/learnedinfo/col_82c9f692cc4dfbaf274869de8a335e5e.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | uhd_restpy/testplatform/sessions/ixnetwork/topology/learnedinfo/col_82c9f692cc4dfbaf274869de8a335e5e.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | uhd_restpy/testplatform/sessions/ixnetwork/topology/learnedinfo/col_82c9f692cc4dfbaf274869de8a335e5e.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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, ... | 38.112069 | 168 | 0.666139 |
75d25515e7c8511a1bb926e66454877f7bd0ff4e | 455 | py | Python | data/scripts/templates/object/draft_schematic/scout/shared_item_trap_flash_bomb.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/draft_schematic/scout/shared_item_trap_flash_bomb.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/draft_schematic/scout/shared_item_trap_flash_bomb.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/scout/shared_item_trap_flash_bomb.iff"
result.attribute_te... | 26.764706 | 81 | 0.731868 |
f1174bcb33ddff259c34a5b7b554cb7dfc82d8dd | 2,507 | py | Python | setup.py | datalayer-externals/jupyterlab-ksmm | 9641c33d8097d7154e424c8388f7092416ce0fcb | [
"MIT"
] | null | null | null | setup.py | datalayer-externals/jupyterlab-ksmm | 9641c33d8097d7154e424c8388f7092416ce0fcb | [
"MIT"
] | null | null | null | setup.py | datalayer-externals/jupyterlab-ksmm | 9641c33d8097d7154e424c8388f7092416ce0fcb | [
"MIT"
] | null | null | null | """ksmm setup
"""
import json
from pathlib import Path
import setuptools
HERE = Path(__file__).parent.resolve()
# The name of the project
name = "ksmm"
lab_path = HERE / name.replace("-", "_") / "labextension"
# Representative files that should exist after a successful build
ensured_targets = [str(lab_path / "pac... | 28.488636 | 87 | 0.658556 |
6e3cc3ec03a1932a70ba5d79b0d7bcc9915186c3 | 1,620 | py | Python | tools/lib/dfbOptions.py | pfloos/QUESTDB_website | 720fb41c42f50e3614cf406fa6cade594f9dd526 | [
"BSD-3-Clause"
] | 2 | 2020-10-29T19:41:52.000Z | 2021-08-12T04:28:33.000Z | tools/lib/dfbOptions.py | rdguerrerom/QUESTDB_website | bebcfdd9596ca90f9c1ca210a68569b767fdfbce | [
"BSD-3-Clause"
] | 1 | 2020-11-20T10:06:44.000Z | 2020-11-20T10:06:44.000Z | tools/lib/dfbOptions.py | rdguerrerom/QUESTDB_website | bebcfdd9596ca90f9c1ca210a68569b767fdfbce | [
"BSD-3-Clause"
] | 2 | 2020-11-16T14:46:02.000Z | 2020-11-24T15:56:47.000Z | from TexSoup import TexSoup,TexCmd
from . import formats
from .data import dataFileBase,DataType,state
from collections import defaultdict
class dfbOptions(object):
def __init__(self):
self.defaultType=DataType.ABS
self.format="line"
self.suffix=None
self.initialStates=defaultdict(lambda : state(1,1,... | 36 | 79 | 0.709877 |
e88c5bdafcb09c209d2d242a067ffb77f25b412a | 230 | py | Python | src/lambdalith_router/__main__.py | andrewthetechie/py-lambdalith-router | a178b1d50b70657a5497b4c201780f406c1c083f | [
"MIT"
] | null | null | null | src/lambdalith_router/__main__.py | andrewthetechie/py-lambdalith-router | a178b1d50b70657a5497b4c201780f406c1c083f | [
"MIT"
] | 4 | 2022-03-18T01:30:37.000Z | 2022-03-31T01:50:38.000Z | src/lambdalith_router/__main__.py | andrewthetechie/py-lambdalith-router | a178b1d50b70657a5497b4c201780f406c1c083f | [
"MIT"
] | null | null | null | """Command-line interface."""
import click
@click.command()
@click.version_option()
def main() -> None:
"""Py Lambdalith Router."""
if __name__ == "__main__":
main(prog_name="py-lambdalith-router") # pragma: no cover
| 17.692308 | 62 | 0.665217 |
c1ca00fc2a9da0c851d6602bd77e1bea6db52288 | 1,058 | py | Python | runoob/advanced_tutorial/thread_3.py | zeroonegit/python | 919f8bb14ae91e37e42ff08192df24b60135596f | [
"MIT"
] | 1 | 2017-03-30T00:43:40.000Z | 2017-03-30T00:43:40.000Z | runoob/advanced_tutorial/thread_3.py | QuinceySun/Python | 919f8bb14ae91e37e42ff08192df24b60135596f | [
"MIT"
] | null | null | null | runoob/advanced_tutorial/thread_3.py | QuinceySun/Python | 919f8bb14ae91e37e42ff08192df24b60135596f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
############################
# File Name: thread_3.py
# Author: One Zero
# Mail: zeroonegit@gmail.com
# Created Time: 2015-12-29 18:58:05
############################
import threading
import time
exitFlag = 0
class myThread(threading.Thread): # 继承父类threading.Thread
... | 24.045455 | 63 | 0.603025 |
976e3d0e806b1ded332d618aaaf09b5b91938eb0 | 1,872 | py | Python | awx_collection/test/awx/test_ad_hoc_wait.py | Geraldf/awx | 10d1b3a3b2680db1e8a7d3b846f5cbce02a37aba | [
"Apache-2.0"
] | 2 | 2021-03-18T11:08:15.000Z | 2021-03-19T09:20:27.000Z | awx_collection/test/awx/test_ad_hoc_wait.py | Saurabh-Thakre/awx | 8eb377a3ea8303c394ad4c958cc828c7239c1e11 | [
"Apache-2.0"
] | 24 | 2021-04-01T08:33:08.000Z | 2022-03-01T21:13:06.000Z | awx_collection/test/awx/test_ad_hoc_wait.py | hostinger/awx | dac01b14e2c04c201a162ea03ef8386d822e3923 | [
"Apache-2.0"
] | 24 | 2020-11-27T08:37:35.000Z | 2021-03-08T13:27:15.000Z | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
from django.utils.timezone import now
from awx.main.models.ad_hoc_commands import AdHocCommand
@pytest.mark.django_db
def test_ad_hoc_command_wait_successful(run_module, admin_user):
command = AdHocCommand.obje... | 33.428571 | 93 | 0.666132 |
5b444f8cef4fb4572c23b45f94b315e1d7dc9244 | 1,199 | py | Python | database/sql_utils/tag.py | john8680/tequila | 23d8a8dae4843bc42cd9dba76d6c07296b0a8632 | [
"Apache-2.0"
] | 3 | 2019-09-27T02:56:54.000Z | 2020-06-15T06:09:54.000Z | database/sql_utils/tag.py | john8680/tequila | 23d8a8dae4843bc42cd9dba76d6c07296b0a8632 | [
"Apache-2.0"
] | null | null | null | database/sql_utils/tag.py | john8680/tequila | 23d8a8dae4843bc42cd9dba76d6c07296b0a8632 | [
"Apache-2.0"
] | 2 | 2019-09-27T02:56:59.000Z | 2019-10-15T10:57:36.000Z | # -*- coding: utf-8 -*-
from tornado import gen
from database.sql_utils.connect import async_connect
@gen.coroutine
def get_all_tags():
conn = yield async_connect()
cur = conn.cursor()
sql = "SELECT tid, tag_name FROM t_tag ORDER BY tid;"
try:
yield cur.execute(sql)
data = cur.fetcha... | 27.883721 | 99 | 0.613845 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.