hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a01ae6d6183dd969db97b7db1b546eb6571cc76 | 4,389 | py | Python | Lectures/Lecture-08/HW-Shokouhi-Ahmadiyan/HW1.py | khalooei/TMLDL2018 | 370b76708d4c0b8b14ed22e321b2c285268c99ef | [
"MIT"
] | 3 | 2018-08-06T15:34:58.000Z | 2022-02-11T14:19:05.000Z | Lectures/Lecture-08/HW-Shokouhi-Ahmadiyan/HW1.py | khalooei/TMLDL2018 | 370b76708d4c0b8b14ed22e321b2c285268c99ef | [
"MIT"
] | null | null | null | Lectures/Lecture-08/HW-Shokouhi-Ahmadiyan/HW1.py | khalooei/TMLDL2018 | 370b76708d4c0b8b14ed22e321b2c285268c99ef | [
"MIT"
] | 3 | 2018-08-06T15:35:01.000Z | 2020-08-08T07:53:07.000Z | import numpy as np
from scipy import optimize
import matplotlib.pyplot as plt
class Neural_Network(object):
def __init__(self):
# Define Hyperparameters
# self.inputLayerSize = 2
# self.outputLayerSize = 1
# self.hiddenLayerSize = 3
self.inputLayerSize = 784
self.out... | 31.804348 | 98 | 0.603554 |
4a01b0088fe1fe2bc9f580a032bb15deb263424f | 25,279 | py | Python | ludwig/encoders/h3_encoders.py | markhsia/ludwig | 4bfb711b169ca4f54a75e1b75b491d37d5971b15 | [
"Apache-2.0"
] | 1 | 2021-07-09T03:17:41.000Z | 2021-07-09T03:17:41.000Z | ludwig/encoders/h3_encoders.py | wuqundong520/ludwig | 13c35ec79f930e7dac295e642d92abe82f8c8046 | [
"Apache-2.0"
] | null | null | null | ludwig/encoders/h3_encoders.py | wuqundong520/ludwig | 13c35ec79f930e7dac295e642d92abe82f8c8046 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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
#
# Unles... | 41.852649 | 88 | 0.580403 |
4a01b0d0b09d9157676399f57469b431765aa0da | 12,493 | py | Python | src/get_data/archive/get_data_arr.py | xmuyzz/IVContrast | f3100e54f1808e1a796acd97ef5d23d0a2fd4f6c | [
"MIT"
] | null | null | null | src/get_data/archive/get_data_arr.py | xmuyzz/IVContrast | f3100e54f1808e1a796acd97ef5d23d0a2fd4f6c | [
"MIT"
] | null | null | null | src/get_data/archive/get_data_arr.py | xmuyzz/IVContrast | f3100e54f1808e1a796acd97ef5d23d0a2fd4f6c | [
"MIT"
] | null | null | null | import glob
import shutil
import os
import pandas as pd
import nrrd
import re
import cv2
from sklearn.model_selection import train_test_split, GroupShuffleSplit
from collections import Counter
import matplotlib
import matplotlib.pyplot as plt
import pickle
#import skimage.transform as st
from tensorflow.keras.utils imp... | 39.040625 | 98 | 0.534379 |
4a01b0f24f456c2c42f17cc603da4ea6caf97c61 | 8,126 | py | Python | proxyclient/m1n1/macho.py | EricRabil/m1n1 | 0a1a9348c32e2e44374720cd9d68cbe81cf696df | [
"MIT"
] | 1,604 | 2021-01-14T19:04:59.000Z | 2022-03-31T18:34:16.000Z | proxyclient/m1n1/macho.py | EricRabil/m1n1 | 0a1a9348c32e2e44374720cd9d68cbe81cf696df | [
"MIT"
] | 105 | 2021-01-15T03:52:27.000Z | 2022-03-30T22:16:52.000Z | proxyclient/m1n1/macho.py | EricRabil/m1n1 | 0a1a9348c32e2e44374720cd9d68cbe81cf696df | [
"MIT"
] | 96 | 2021-01-14T21:13:53.000Z | 2022-03-31T12:14:14.000Z | # SPDX-License-Identifier: MIT
from io import BytesIO, SEEK_END, SEEK_SET
import bisect
from construct import *
from .utils import *
__all__ = ["MachO"]
MachOLoadCmdType = "LoadCmdType" / Enum(Int32ul,
SYMTAB = 0x02,
UNIXTHREAD = 0x05,
SEGMENT_64 = 0x19,
UUID = 0x1b,
BUILD_VERSION = 0x32,
DYL... | 31.866667 | 113 | 0.577037 |
4a01b1d95534179931ef0919a400c09158b0453c | 886 | py | Python | Resene naloge/euler33.py | CadezDavid/ProjectEuler | 9e11aa5782fb600c98eba9e04766b3bd79acea0e | [
"MIT"
] | null | null | null | Resene naloge/euler33.py | CadezDavid/ProjectEuler | 9e11aa5782fb600c98eba9e04766b3bd79acea0e | [
"MIT"
] | null | null | null | Resene naloge/euler33.py | CadezDavid/ProjectEuler | 9e11aa5782fb600c98eba9e04766b3bd79acea0e | [
"MIT"
] | null | null | null | import fractions
# def krajsanje(n, m):
# list = []
# m = [i for i in str(m)]
# n = [i for i in str(n)]
# k = list(set(m).symmetric_difference(n))
# if min(m, n) / max(m, n) == min(k[0], k[1]) / max(k[0], k[1])
# list.append([m, n])
def odstrani_skupne(m, n):
if '0' in str(n):
... | 28.580645 | 67 | 0.549661 |
4a01b25fe4d6c5358c7fab4d04ee04219b9b53b1 | 23,620 | py | Python | src/compiler/vhdl_gen.py | luinaudt/deparser | 06d3c82ee151da4cef2823015d56bf867e0205f6 | [
"Apache-2.0"
] | 7 | 2021-02-25T14:48:39.000Z | 2022-03-05T06:46:01.000Z | src/compiler/vhdl_gen.py | luinaudt/deparser | 06d3c82ee151da4cef2823015d56bf867e0205f6 | [
"Apache-2.0"
] | null | null | null | src/compiler/vhdl_gen.py | luinaudt/deparser | 06d3c82ee151da4cef2823015d56bf867e0205f6 | [
"Apache-2.0"
] | 1 | 2020-12-15T08:23:11.000Z | 2020-12-15T08:23:11.000Z | from colorama import Fore, Style
from string import Template
from os import path, mkdir, scandir
from shutil import copyfile
import networkx as nx
from warnings import warn
import vhdl_util
VERSION = 0.1
class deparserHDL(object):
def __getlibrary(self):
"""set a dictionnary with library folder
e... | 39.76431 | 81 | 0.512151 |
4a01b3729f5904d4c48a50e0f33c0bd90cbb9916 | 20,842 | py | Python | lingvo/tasks/lm/model.py | j-luo93/lingvo | 7398974078391362f0c1b027164a8f33f88cf86b | [
"Apache-2.0"
] | 4 | 2019-01-08T02:59:38.000Z | 2022-02-18T11:31:37.000Z | lingvo/tasks/lm/model.py | j-luo93/lingvo | 7398974078391362f0c1b027164a8f33f88cf86b | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/lm/model.py | j-luo93/lingvo | 7398974078391362f0c1b027164a8f33f88cf86b | [
"Apache-2.0"
] | 1 | 2019-07-02T14:09:42.000Z | 2019-07-02T14:09:42.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.767535 | 161 | 0.647587 |
4a01b3b3187cd32561ac5627aa749d00d8bef6e7 | 2,127 | py | Python | src/server/unix_user_handler.py | CDAT/libcdms | 5ae832b52c8235ff859ce8e099347d42943bbd8a | [
"BSD-3-Clause"
] | null | null | null | src/server/unix_user_handler.py | CDAT/libcdms | 5ae832b52c8235ff859ce8e099347d42943bbd8a | [
"BSD-3-Clause"
] | 3 | 2018-05-28T01:12:59.000Z | 2020-11-05T00:56:00.000Z | src/server/unix_user_handler.py | UV-CDAT/libcdms | 5ae832b52c8235ff859ce8e099347d42943bbd8a | [
"BSD-3-Clause"
] | null | null | null | # -*- Mode: Python; tab-width: 4 -*-
#
# Author: Sam Rushing <rushing@nightmare.com>
# Copyright 1996, 1997 by Sam Rushing
# All Rights Reserved.
#
# This software is provided free for non-commercial use. If you are
# interested in using this software in a commercial context, or in
# purchasing support, please c... | 24.448276 | 86 | 0.686883 |
4a01b3d51a793b1f82b03886cc24dc79e45aad08 | 10,270 | py | Python | numba/cuda/tests/cudapy/test_array.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2021-08-10T05:33:29.000Z | 2021-08-10T05:33:29.000Z | numba/cuda/tests/cudapy/test_array.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | numba/cuda/tests/cudapy/test_array.py | luk-f-a/numba | 3a682bd827e416335e3574bc7b10f0ec69adb701 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2021-01-31T18:58:54.000Z | 2021-01-31T18:58:54.000Z | import numpy as np
from numba.cuda.testing import unittest, CUDATestCase
from numba.cuda.testing import skip_on_cudasim, skip_unless_cudasim
from numba import config, cuda
if config.ENABLE_CUDASIM:
ARRAY_LIKE_FUNCTIONS = (cuda.device_array_like, cuda.pinned_array_like)
else:
ARRAY_LIKE_FUNCTIONS = (cuda.devi... | 40.433071 | 79 | 0.606232 |
4a01b477b935366f9261af54b85e8a4540ee66f7 | 5,045 | py | Python | lazy/serialize/_multi.py | trisongz/lazycls | 701bad1a358ed3bb136347d0c5eb81de3201f6a3 | [
"MIT"
] | 2 | 2021-12-02T00:13:16.000Z | 2022-02-26T11:18:33.000Z | lazy/serialize/_multi.py | trisongz/lazycls | 701bad1a358ed3bb136347d0c5eb81de3201f6a3 | [
"MIT"
] | null | null | null | lazy/serialize/_multi.py | trisongz/lazycls | 701bad1a358ed3bb136347d0c5eb81de3201f6a3 | [
"MIT"
] | null | null | null | """
Serializers that depend on/combine with one another
"""
__all__ = (
'YamlBase64', 'YamlBGZ',
'JsonBase64', 'JasonBGZ'
)
from typing import Dict, Any, List, Union
from .core import Defaults
from ._json import Json
from ._yaml import Yaml
from ._base import Base
class YamlBase64(Yaml):
@classm... | 44.254386 | 145 | 0.645193 |
4a01b6221aba07cbb41dae59227ed22f3d630822 | 681 | py | Python | examples/cat.py | lggruspe/genbu | fd87ae31155eabc12aaf02ebfcf34b05c77dc428 | [
"MIT"
] | 1 | 2021-05-01T15:35:19.000Z | 2021-05-01T15:35:19.000Z | examples/cat.py | lggruspe/genbu | fd87ae31155eabc12aaf02ebfcf34b05c77dc428 | [
"MIT"
] | null | null | null | examples/cat.py | lggruspe/genbu | fd87ae31155eabc12aaf02ebfcf34b05c77dc428 | [
"MIT"
] | null | null | null | from pathlib import Path
import sys
from genbu import Genbu, Param, combinators as comb, usage
def cat(path: Path) -> str:
"""Concatenate contents of path to stdout."""
return path.read_text()
cli = Genbu(
cat,
params=[
Param("path", ["-p", "--path"], comb.One(Path)),
Param(
... | 21.967742 | 70 | 0.53304 |
4a01b623b1a720e132b35e08389234331b8b3c72 | 2,490 | py | Python | src/schema2rst/inspectors/mysql.py | MindStrongHealth/schema2rst | 50f4f6b238c2a4a16ce3ad067dbab698f1d19a41 | [
"Apache-1.1"
] | 1 | 2020-11-19T17:49:35.000Z | 2020-11-19T17:49:35.000Z | src/schema2rst/inspectors/mysql.py | MindStrongHealth/schema2rst | 50f4f6b238c2a4a16ce3ad067dbab698f1d19a41 | [
"Apache-1.1"
] | null | null | null | src/schema2rst/inspectors/mysql.py | MindStrongHealth/schema2rst | 50f4f6b238c2a4a16ce3ad067dbab698f1d19a41 | [
"Apache-1.1"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2011 Takeshi KOMIYA
#
# 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... | 38.307692 | 76 | 0.579518 |
4a01b7075267862df8fe9b44dca3848ded346f01 | 10,682 | py | Python | digani/res/email/email_extractor.py | ZwEin27/dig-attribute-name-identification | 669c2d4f66560e4085884a5d0c259390214ef69f | [
"Apache-2.0"
] | null | null | null | digani/res/email/email_extractor.py | ZwEin27/dig-attribute-name-identification | 669c2d4f66560e4085884a5d0c259390214ef69f | [
"Apache-2.0"
] | null | null | null | digani/res/email/email_extractor.py | ZwEin27/dig-attribute-name-identification | 669c2d4f66560e4085884a5d0c259390214ef69f | [
"Apache-2.0"
] | null | null | null | import re
import json
from sets import Set
class EE(object):
"""Extractor of email addresses from text.
The legal definition is in https://en.wikipedia.org/wiki/Email_address
This class attempts to map purposefully obfuscated email addresses to legal addresses.
Users of this class should call EE.extr... | 39.858209 | 138 | 0.536791 |
4a01b7311ae380d50e1402b5c97a99328da0137f | 470 | py | Python | Scripts/vowel.py | yashrajmani/hacktoberfest2021 | 871c4ce3b5c0353e5f737f895ea79e46d3fedf20 | [
"MIT"
] | 15 | 2021-10-03T08:27:22.000Z | 2022-01-10T11:20:56.000Z | Scripts/vowel.py | yashrajmani/hacktoberfest2021 | 871c4ce3b5c0353e5f737f895ea79e46d3fedf20 | [
"MIT"
] | 3 | 2021-10-03T08:23:57.000Z | 2021-10-15T05:21:15.000Z | Scripts/vowel.py | yashrajmani/hacktoberfest2021 | 871c4ce3b5c0353e5f737f895ea79e46d3fedf20 | [
"MIT"
] | 51 | 2021-10-03T08:20:44.000Z | 2021-10-31T12:51:11.000Z | y=input("Enter a string:")
k=len(y)
u=0
l=0
v=0
c=0
for i in range(k):
if y[i] in ['A','E','I','O','U']:
v+=1
u+=1
elif y[i] in ['a','e','i','o','u']:
v+=1
l+=1
else:
if y[i].isupper()==True:
c+=1
u+=1
else:
c+=1
l... | 18.8 | 39 | 0.442553 |
4a01b80ef7fd3042cb585acbdf15c7183cfdd0cf | 2,991 | py | Python | backend/env/shopstopbackend/api/migrations/0001_initial.py | heleneelling/TDT4140-PU | 0dabe0873fae7ebd45737798157a2b1b57fc74e2 | [
"MIT"
] | null | null | null | backend/env/shopstopbackend/api/migrations/0001_initial.py | heleneelling/TDT4140-PU | 0dabe0873fae7ebd45737798157a2b1b57fc74e2 | [
"MIT"
] | null | null | null | backend/env/shopstopbackend/api/migrations/0001_initial.py | heleneelling/TDT4140-PU | 0dabe0873fae7ebd45737798157a2b1b57fc74e2 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.2 on 2020-02-11 09:12
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Groups',
fields=[
('groupid', models.AutoFi... | 35.607143 | 114 | 0.506854 |
4a01b8445e27a0f667718077fc3e52adea63e1c0 | 17,317 | py | Python | python/dgl/backend/pytorch/tensor.py | zheng-da/dgl | 8091419468628039af1f9f4b5185bedbb26eb8f4 | [
"Apache-2.0"
] | 2 | 2020-08-05T07:21:51.000Z | 2021-02-20T10:22:23.000Z | python/dgl/backend/pytorch/tensor.py | zheng-da/dgl | 8091419468628039af1f9f4b5185bedbb26eb8f4 | [
"Apache-2.0"
] | 1 | 2019-02-06T02:02:41.000Z | 2019-02-06T20:22:32.000Z | python/dgl/backend/pytorch/tensor.py | zheng-da/dgl-1 | 8091419468628039af1f9f4b5185bedbb26eb8f4 | [
"Apache-2.0"
] | 3 | 2019-03-04T12:46:05.000Z | 2019-08-14T18:53:19.000Z | from __future__ import absolute_import
from distutils.version import LooseVersion
import scipy # Weird bug in new pytorch when import scipy after import torch
import torch as th
import builtins
import numbers
from torch.utils import dlpack
from ... import ndarray as nd
from ..._deprecate import kernel as K
from ...f... | 32.068519 | 99 | 0.650113 |
4a01b8839b9b9b6546fcafc4078d95b585237cf0 | 3,961 | py | Python | sdk/python/pulumi_aws/licensemanager/association.py | johnktims/pulumi-aws | c838bc79043f5376c66fc66275a1e012edd3ab7d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/licensemanager/association.py | johnktims/pulumi-aws | c838bc79043f5376c66fc66275a1e012edd3ab7d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/licensemanager/association.py | johnktims/pulumi-aws | c838bc79043f5376c66fc66275a1e012edd3ab7d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Associ... | 45.011364 | 165 | 0.69124 |
4a01b902c2553e671bf68dd7e97ae315eaa0af72 | 2,124 | py | Python | synapse/logging/utils.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | 9,945 | 2015-01-02T07:41:06.000Z | 2022-03-31T23:22:42.000Z | synapse/logging/utils.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 9,320 | 2015-01-08T14:09:03.000Z | 2022-03-31T21:11:24.000Z | synapse/logging/utils.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 2,299 | 2015-01-31T22:16:29.000Z | 2022-03-31T06:08:26.000Z | # Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 27.584416 | 87 | 0.621469 |
4a01b926ca238816fd61a82aa136c160340de729 | 486 | py | Python | Chap3/plotcapacity.py | thomaskamalakis/telecomsystems | 476350a121debfd580dced0823b4bcf94f1f896d | [
"MIT"
] | 2 | 2022-01-12T11:46:39.000Z | 2022-01-25T16:49:45.000Z | Chap3/plotcapacity.py | thomaskamalakis/telecomsystems | 476350a121debfd580dced0823b4bcf94f1f896d | [
"MIT"
] | null | null | null | Chap3/plotcapacity.py | thomaskamalakis/telecomsystems | 476350a121debfd580dced0823b4bcf94f1f896d | [
"MIT"
] | 7 | 2021-09-17T13:09:07.000Z | 2022-01-26T16:58:25.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 7 21:00:00 2019
@author: thomas
"""
import numpy as np
import matplotlib.pyplot as plt
font = {'family' : 'serif',
'weight' : 'normal',
'size' : 16}
plt.rc('font', **font)
T=4;
pe = np.arange(0.01, 1, 0.01)
Rmax=1.0+pe*np.log2... | 18.692308 | 48 | 0.604938 |
4a01b9343b29a1538d35a8b6dfe3a50d1ddda9f5 | 1,997 | py | Python | invenio_app_ils/document_requests/mail/messages.py | topless/invenio-app-ils | 38f5a6b61cdeaf5fa5776613073fa46af28737a9 | [
"MIT"
] | null | null | null | invenio_app_ils/document_requests/mail/messages.py | topless/invenio-app-ils | 38f5a6b61cdeaf5fa5776613073fa46af28737a9 | [
"MIT"
] | 21 | 2018-11-02T14:19:53.000Z | 2021-06-25T15:16:42.000Z | invenio_app_ils/document_requests/mail/messages.py | topless/invenio-app-ils | 38f5a6b61cdeaf5fa5776613073fa46af28737a9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Document requests mail message objects."""
import os
from flask import current_app
from invenio_app_ils.mail.... | 32.737705 | 80 | 0.651978 |
4a01b98b66772b85a4103e4442074d7b8f2af602 | 4,437 | py | Python | sol/test_parser.py | ianpreston/sol | 469fff7f7aff8469e7a2731fbf4b06de0db78836 | [
"MIT"
] | null | null | null | sol/test_parser.py | ianpreston/sol | 469fff7f7aff8469e7a2731fbf4b06de0db78836 | [
"MIT"
] | null | null | null | sol/test_parser.py | ianpreston/sol | 469fff7f7aff8469e7a2731fbf4b06de0db78836 | [
"MIT"
] | null | null | null | import pytest
from sol.parser import SolParser, ParseError
from sol.lexer import Token, TokenType
from sol.ast import (
MsgAstNode,
IdentAstNode,
AssignAstNode,
ConstAstNode,
ConstType,
)
def test_msg_pass():
tokens = [
Token(TokenType.IDENT, 'foo'),
Token(TokenType.DOT, '.'),
... | 26.254438 | 56 | 0.618211 |
4a01b98e2d8bf53902fb3537a86c9ef8ebcb8ff7 | 712 | py | Python | Python implementation/CallKinDrape.py | chrkrogh/KinDrape | 6a04c01470409741c8d7ab638636646aba24dcbe | [
"MIT"
] | 1 | 2022-03-04T08:27:49.000Z | 2022-03-04T08:27:49.000Z | Python implementation/CallKinDrape.py | chrkrogh/KinDrape | 6a04c01470409741c8d7ab638636646aba24dcbe | [
"MIT"
] | null | null | null | Python implementation/CallKinDrape.py | chrkrogh/KinDrape | 6a04c01470409741c8d7ab638636646aba24dcbe | [
"MIT"
] | 1 | 2021-06-04T13:52:17.000Z | 2021-06-04T13:52:17.000Z | # Script to define input and call KinDrape
import KinDrape as kd
import time
# Input parameters to KinDrape:
# d: discretization distance
# Grid: Dimensions of fabric grid (rows, columns)
# Org: x,y origin point on mold
# Ang: Initial draping direction rel. to y-axis
# OrgNode: Origin node of grid (row, column)
# S... | 30.956522 | 73 | 0.671348 |
4a01b9a1ec8ebceca25fbe8bba93749ac3bae972 | 7,795 | py | Python | python/onshape_client/oas/models/bt_export_tessellated_edges_body890.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 14 | 2019-06-23T08:47:41.000Z | 2021-11-29T16:28:45.000Z | python/onshape_client/oas/models/bt_export_tessellated_edges_body890.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 40 | 2019-05-22T14:39:46.000Z | 2022-03-10T10:36:17.000Z | python/onshape_client/oas/models/bt_export_tessellated_edges_body890.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 24 | 2019-06-02T01:03:41.000Z | 2022-03-29T13:25:36.000Z | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | 36.425234 | 117 | 0.62848 |
4a01b9d09f7f2f04e5b9790962caca29c0b42f5d | 6,103 | py | Python | detector/src/loss.py | cersar/2D_detection | 620ccc1b120617ead1ccd98e27022f8746e82071 | [
"Apache-2.0"
] | 3 | 2021-10-21T03:30:00.000Z | 2022-03-02T13:12:19.000Z | detector/src/loss.py | cersar/2D_detection | 620ccc1b120617ead1ccd98e27022f8746e82071 | [
"Apache-2.0"
] | null | null | null | detector/src/loss.py | cersar/2D_detection | 620ccc1b120617ead1ccd98e27022f8746e82071 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from tensorflow.keras.losses import binary_crossentropy
from detector.src.box_utils import *
def focal_loss(
y_true,
y_pred,
alpha=0.25,
gamma=2.0,
label_smoothing=0.0,
from_logits=False,
) -> tf.Tensor:
"""Implements the focal loss function.... | 39.121795 | 144 | 0.683271 |
4a01baff196a03bfd84e6178d214532bbba9ed8f | 7,532 | py | Python | mechroutines/es/runner/_wfn.py | keceli/mechdriver | 978994ba5c77b6df00078b639c4482dacf269440 | [
"Apache-2.0"
] | null | null | null | mechroutines/es/runner/_wfn.py | keceli/mechdriver | 978994ba5c77b6df00078b639c4482dacf269440 | [
"Apache-2.0"
] | null | null | null | mechroutines/es/runner/_wfn.py | keceli/mechdriver | 978994ba5c77b6df00078b639c4482dacf269440 | [
"Apache-2.0"
] | 8 | 2019-12-18T20:09:46.000Z | 2020-11-14T16:37:28.000Z | """ Set runtime parameters for multireference electronic structure calculations
"""
import copy
import automol
import elstruct
from phydat import act_space
from mechanalyzer.inf import spc as sinfo
from mechanalyzer.inf import rxn as rinfo
from mechlib.amech_io import printer as ioprinter
# BUILD THE MULTIREFERENCE ... | 33.035088 | 83 | 0.630244 |
4a01bb09054485f5b1b61a5cdd7184d0456869f3 | 24,828 | py | Python | code/ranking_experiments.py | clips/clinspell | 9ec38827b367cfa814f2adce56f909db15052c3e | [
"MIT"
] | 74 | 2017-05-16T07:07:12.000Z | 2022-02-06T10:00:55.000Z | code/ranking_experiments.py | clips/clinspell | 9ec38827b367cfa814f2adce56f909db15052c3e | [
"MIT"
] | 8 | 2018-01-24T04:14:23.000Z | 2021-08-24T21:50:18.000Z | code/ranking_experiments.py | clips/clinspell | 9ec38827b367cfa814f2adce56f909db15052c3e | [
"MIT"
] | 18 | 2017-07-03T12:47:33.000Z | 2021-09-08T18:31:44.000Z | # dependencies
from pyxdameraulevenshtein import damerau_levenshtein_distance
import fasttext
from doublemetaphone import dm
import numpy as np
# built-in packages
from functools import reduce
from statistics import mean
from math import log
import random
import json
import time
# development experiments
class Deve... | 41.242525 | 126 | 0.600209 |
4a01bb56173c21c5ae85d8803263240e473f8934 | 1,391 | py | Python | src/ralph_scrooge/models/base.py | xliiv/ralph_pricing | 88a295b6f0af66ae03c145205ada99f17ab51dd0 | [
"Apache-2.0"
] | null | null | null | src/ralph_scrooge/models/base.py | xliiv/ralph_pricing | 88a295b6f0af66ae03c145205ada99f17ab51dd0 | [
"Apache-2.0"
] | null | null | null | src/ralph_scrooge/models/base.py | xliiv/ralph_pricing | 88a295b6f0af66ae03c145205ada99f17ab51dd0 | [
"Apache-2.0"
] | 1 | 2021-11-15T21:21:17.000Z | 2021-11-15T21:21:17.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.db import models as db
from django.utils.translation import ugettext_lazy as _
from lck.django.choices import Choices
from lck.django... | 25.759259 | 76 | 0.641984 |
4a01bde32b2da347d153fd3804ee629e68c7fcbf | 60,482 | py | Python | nmigen/hdl/ast.py | davidlattimore/nmigen | 8fe319f065807f421b092e7ffb8b90748512bf8c | [
"BSD-2-Clause"
] | null | null | null | nmigen/hdl/ast.py | davidlattimore/nmigen | 8fe319f065807f421b092e7ffb8b90748512bf8c | [
"BSD-2-Clause"
] | null | null | null | nmigen/hdl/ast.py | davidlattimore/nmigen | 8fe319f065807f421b092e7ffb8b90748512bf8c | [
"BSD-2-Clause"
] | null | null | null | from abc import ABCMeta, abstractmethod
import traceback
import warnings
import typing
from collections import OrderedDict
from collections.abc import Iterable, MutableMapping, MutableSet, MutableSequence
from enum import Enum
from .. import tracer
from .._utils import *
from .._unused import *
__all__ = [
"Shap... | 34.920323 | 183 | 0.578883 |
4a01bdf78d4cd2737597e62179d0c546db3fa385 | 8,258 | py | Python | TikTok Video Generator/vidGen.py | ADH36/TikTok-Compilation-Video-Generator | 375cdf41ee7e73b9e4bb8d6f0b9b6400892f136f | [
"MIT"
] | 199 | 2020-09-05T16:20:00.000Z | 2022-03-31T15:57:25.000Z | TikTok Video Generator/vidGen.py | ozgurozkayaa/TikTok-Compilation-Video-Generator | 9fce0e967682eb92a196f4ac4afa985eb593551c | [
"MIT"
] | 28 | 2020-09-24T22:01:14.000Z | 2022-03-18T07:19:24.000Z | TikTok Video Generator/vidGen.py | ozgurozkayaa/TikTok-Compilation-Video-Generator | 9fce0e967682eb92a196f4ac4afa985eb593551c | [
"MIT"
] | 56 | 2020-09-22T00:29:53.000Z | 2022-03-20T19:22:51.000Z | import random
import os
import time
import shutil
import subprocess
import re
import cv2
from time import sleep
import datetime
from distutils.dir_util import copy_tree
import pickle
import settings
#File Paths
#Creating file paths that are needed
saved_videos = None
render_current_progress =... | 33.032 | 220 | 0.593848 |
4a01be0b8d95d183c319ac7bf960de5e3a204ee0 | 37 | py | Python | sdk/template/azure-template/azure/template/_version.py | conniey/azure-sdk-for-python | f779de8e53dbec033f98f976284e6d9491fd60b3 | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/template/azure-template/azure/template/_version.py | conniey/azure-sdk-for-python | f779de8e53dbec033f98f976284e6d9491fd60b3 | [
"MIT"
] | null | null | null | sdk/template/azure-template/azure/template/_version.py | conniey/azure-sdk-for-python | f779de8e53dbec033f98f976284e6d9491fd60b3 | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # matches SEMVER
VERSION = "0.0.13b1" | 18.5 | 20 | 0.702703 |
4a01bf6d763de749dcf0615fa62b769d921afb30 | 1,898 | py | Python | python/study_myself/12_json/steps.py | harkhuang/harkcode | 1c9802bfc8d599e20ee9082eca14165a782ddf85 | [
"MIT"
] | 3 | 2015-10-27T00:49:46.000Z | 2019-04-19T08:14:46.000Z | python/study_myself/12_json/steps.py | harkhuang/harkcode | 1c9802bfc8d599e20ee9082eca14165a782ddf85 | [
"MIT"
] | 1 | 2018-11-05T07:54:55.000Z | 2018-11-05T07:54:55.000Z | python/study_myself/12_json/steps.py | harkhuang/harkcode | 1c9802bfc8d599e20ee9082eca14165a782ddf85 | [
"MIT"
] | 1 | 2015-12-19T08:47:53.000Z | 2015-12-19T08:47:53.000Z | import json
import array
from pprint import pprint
# get the version depend trees
versions_deps = []
with open('data.json') as f:
data = json.load(f)
for (k,v) in data["version"].items():
versions_deps.append(k)
#pprint(k + '\n')
from_v = "P2019-06-02"
to_v = "P2019-05-03"
steps = list()
#step1 degrade to ... | 22.595238 | 58 | 0.600632 |
4a01bf9213393a7406727a3730853ab12a23ba8f | 5,268 | py | Python | modin/data_management/functions/default_methods/groupby_default.py | ienkovich/modin | b7e1188f7ba01e3a313996e092a65b63f6b76fa0 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-05-19T04:01:17.000Z | 2021-05-19T04:01:17.000Z | modin/data_management/functions/default_methods/groupby_default.py | ienkovich/modin | b7e1188f7ba01e3a313996e092a65b63f6b76fa0 | [
"ECL-2.0",
"Apache-2.0"
] | 57 | 2021-01-22T15:52:03.000Z | 2021-06-12T18:22:04.000Z | modin/data_management/functions/default_methods/groupby_default.py | ienkovich/modin | b7e1188f7ba01e3a313996e092a65b63f6b76fa0 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-01-29T12:12:42.000Z | 2022-01-29T12:12:42.000Z | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 31.73494 | 87 | 0.567008 |
4a01bfeb49e116f78ed8583ab43ac5749c422eb6 | 1,732 | py | Python | DataPrepUtils/normalize.py | shreyanshchordia/Chatbot | abdbda328d25b6c0deecc840fff625451f92d871 | [
"MIT"
] | null | null | null | DataPrepUtils/normalize.py | shreyanshchordia/Chatbot | abdbda328d25b6c0deecc840fff625451f92d871 | [
"MIT"
] | null | null | null | DataPrepUtils/normalize.py | shreyanshchordia/Chatbot | abdbda328d25b6c0deecc840fff625451f92d871 | [
"MIT"
] | null | null | null |
# function to normalize string
'''
Involves making tokens more seperable and distinguishable,
for example:
"What are y'all gonn' do tonight?I hope it's fun or I better leave now!"
> 'What are y all gonn do tonight ? I hope it s fun or I better leave now !'
'''
import re
def normalize_string(string):
s... | 23.093333 | 84 | 0.534642 |
4a01c0902e936efd2f571d102d672e286d6e6cc1 | 2,175 | py | Python | videos/migrations/0001_initial.py | engineerscodes/PROTO-SEEK | f46a8a04f9a04151241015cc98cc79bfb4df0209 | [
"MIT"
] | 1 | 2021-06-05T08:45:48.000Z | 2021-06-05T08:45:48.000Z | videos/migrations/0001_initial.py | engineerscodes/PROTO-SEEK | f46a8a04f9a04151241015cc98cc79bfb4df0209 | [
"MIT"
] | null | null | null | videos/migrations/0001_initial.py | engineerscodes/PROTO-SEEK | f46a8a04f9a04151241015cc98cc79bfb4df0209 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.1 on 2021-05-27 10:36
import django.core.validators
from django.db import migrations, models
import videos.VideoSizeVal
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='videoUpload',
... | 44.387755 | 200 | 0.585747 |
4a01c165b2af3ae5dc9cb9542f8197626df1cc0f | 13,505 | py | Python | torch/fx/experimental/fx2trt/lower.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | null | null | null | torch/fx/experimental/fx2trt/lower.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | null | null | null | torch/fx/experimental/fx2trt/lower.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | null | null | null | import dataclasses as dc
import logging
import typing as t
from typing import Type, Set, Optional
import tensorrt as trt
import torch
import torch.fx as fx
import torch.fx.experimental.fx_acc.acc_tracer as acc_tracer
import torch.nn as nn
from torch.fx.experimental.const_fold import split_const_subgraphs
from .fx2trt... | 36.206434 | 127 | 0.691077 |
4a01c1f3119f6d3a6d689edb6b8b0fd2f8d79444 | 185 | wsgi | Python | heroku_deploy.wsgi | doublechiang/pcdvd_getuserpost | 654aa385396792cf0c51570cff81c4921e8c8293 | [
"Apache-2.0"
] | null | null | null | heroku_deploy.wsgi | doublechiang/pcdvd_getuserpost | 654aa385396792cf0c51570cff81c4921e8c8293 | [
"Apache-2.0"
] | 4 | 2021-05-12T00:03:03.000Z | 2021-06-14T23:29:26.000Z | heroku_deploy.wsgi | doublechiang/pcdvd_userpost_by_thread | 654aa385396792cf0c51570cff81c4921e8c8293 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
# from QMFRacklog import app as application
from app import app as application | 30.833333 | 62 | 0.789189 |
4a01c3499a364326143673f1c8d5448ca9366501 | 8,154 | py | Python | jaseci_kit/jaseci_kit/modules/encoders/utils/tokenizer.py | Gorgeous-Patrick/jaseci | b423165fefbbc9574cd4467ee05728add7f47e5a | [
"MIT"
] | 6 | 2021-10-30T03:35:36.000Z | 2022-02-10T02:06:18.000Z | jaseci_kit/jaseci_kit/modules/encoders/utils/tokenizer.py | Gorgeous-Patrick/jaseci | b423165fefbbc9574cd4467ee05728add7f47e5a | [
"MIT"
] | 85 | 2021-10-29T22:47:39.000Z | 2022-03-31T06:11:52.000Z | jaseci_kit/jaseci_kit/modules/encoders/utils/tokenizer.py | Gorgeous-Patrick/jaseci | b423165fefbbc9574cd4467ee05728add7f47e5a | [
"MIT"
] | 12 | 2021-11-03T17:29:22.000Z | 2022-03-30T16:01:53.000Z | import torch
from torch.utils.data import Dataset
# this class transforms data in required training format
# and inference for text and tokens
class SelectionDataset(Dataset):
def __init__(
self,
contexts,
candidates,
context_transform,
candidate_transform,
labels=N... | 36.895928 | 87 | 0.597008 |
4a01c37a5e5bfb6de9b949c72f7f86d3598c8ee1 | 9,018 | py | Python | test/functional/feature_signet.py | afco2021/afco_sourcecode | 886fe458a4a7c7f4ac999a8bad64422ad1fd8736 | [
"MIT"
] | null | null | null | test/functional/feature_signet.py | afco2021/afco_sourcecode | 886fe458a4a7c7f4ac999a8bad64422ad1fd8736 | [
"MIT"
] | null | null | null | test/functional/feature_signet.py | afco2021/afco_sourcecode | 886fe458a4a7c7f4ac999a8bad64422ad1fd8736 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test basic signet functionality"""
from decimal import Decimal
from test_framework.test_framework imp... | 120.24 | 666 | 0.91018 |
4a01c3ea33b7d1ca60ce8d7ce1b23f4a5bd4dad6 | 1,416 | py | Python | setup.py | Dry8r3aD/penta-nps | a4c74a2cd90eb2f95158e2040b7eca7056b062db | [
"MIT"
] | 6 | 2016-09-25T07:26:22.000Z | 2022-03-16T06:30:05.000Z | setup.py | Dry8r3aD/penta-nps | a4c74a2cd90eb2f95158e2040b7eca7056b062db | [
"MIT"
] | 14 | 2016-10-04T00:02:20.000Z | 2017-02-22T03:06:21.000Z | setup.py | Dry8r3aD/penta-nps | a4c74a2cd90eb2f95158e2040b7eca7056b062db | [
"MIT"
] | 5 | 2016-10-06T04:53:32.000Z | 2019-12-08T13:48:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
from distutils.core import setup
from distutils.command.install import install
import nps
SCRIPTS = ['bin/nps... | 28.897959 | 63 | 0.629237 |
4a01c4a41c0015c92fb5661e02c46885765dae8e | 6,143 | py | Python | cherami_client/publisher.py | fakeNetflix/uber-repo-cherami-client-python | 05274549a39e29748f7649c3455707d32fe08a15 | [
"MIT"
] | null | null | null | cherami_client/publisher.py | fakeNetflix/uber-repo-cherami-client-python | 05274549a39e29748f7649c3455707d32fe08a15 | [
"MIT"
] | null | null | null | cherami_client/publisher.py | fakeNetflix/uber-repo-cherami-client-python | 05274549a39e29748f7649c3455707d32fe08a15 | [
"MIT"
] | null | null | null | # Copyright (c) 2017 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | 39.88961 | 107 | 0.659775 |
4a01c4e24baac464ffdbd33dfa73231212f528ba | 4,780 | py | Python | bokeh/_testing/util/filesystem.py | jeisch/bokeh | 6be4d5ebbec04117f2bb0693fe64dc664f8f1bb1 | [
"BSD-3-Clause"
] | 1 | 2020-03-21T04:11:51.000Z | 2020-03-21T04:11:51.000Z | bokeh/_testing/util/filesystem.py | jeisch/bokeh | 6be4d5ebbec04117f2bb0693fe64dc664f8f1bb1 | [
"BSD-3-Clause"
] | 2 | 2021-05-08T11:43:21.000Z | 2021-05-10T19:16:43.000Z | bokeh/_testing/util/filesystem.py | jeisch/bokeh | 6be4d5ebbec04117f2bb0693fe64dc664f8f1bb1 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 29.506173 | 99 | 0.449582 |
4a01c568bfff51604ce570b79e0f232db1c1cad5 | 1,797 | py | Python | clustergrammer/proc_df_labels.py | scvannost/clustergrammer-py | 6e5987694e52c5cabfd25a90f0bc628d95c09140 | [
"MIT"
] | 13 | 2017-03-30T18:03:06.000Z | 2021-12-09T17:36:12.000Z | clustergrammer/proc_df_labels.py | scvannost/clustergrammer-py | 6e5987694e52c5cabfd25a90f0bc628d95c09140 | [
"MIT"
] | 14 | 2016-11-06T00:57:23.000Z | 2022-03-25T00:51:07.000Z | clustergrammer/proc_df_labels.py | scvannost/clustergrammer-py | 6e5987694e52c5cabfd25a90f0bc628d95c09140 | [
"MIT"
] | 13 | 2016-11-05T22:21:00.000Z | 2021-05-05T14:52:51.000Z | def main(df):
'''
1) check that rows are strings (in case of numerical names)
2) check for tuples, and in that case load tuples to categories
'''
import numpy as np
from ast import literal_eval as make_tuple
test = {}
test['row'] = df['mat'].index.tolist()
test['col'] = df['mat'].columns.tolist()
... | 28.983871 | 91 | 0.597663 |
4a01c6645cdd4827e46964019e573b6cf25a2107 | 1,013 | py | Python | from_python_community/is_happy_ip.py | ZaytsevNS/python_practice | 109e14923a2ddeacc5360fd72947275afd2159e3 | [
"MIT"
] | null | null | null | from_python_community/is_happy_ip.py | ZaytsevNS/python_practice | 109e14923a2ddeacc5360fd72947275afd2159e3 | [
"MIT"
] | null | null | null | from_python_community/is_happy_ip.py | ZaytsevNS/python_practice | 109e14923a2ddeacc5360fd72947275afd2159e3 | [
"MIT"
] | null | null | null | # Условие:
# Найти «счастливый» ip. Он считается счастливым, если сумма двух байтов с левой стороны равняются сумме двух байтов с правой стороны.
# На вход функции всегда идёт строка с ipv4 адресом.
# Пример:
# is_happy_ip("255.255.255.255") -> True
# is_happy_ip("0.0.0.1") -> False
# is_happy_ip("101.78.170.9") ->... | 28.138889 | 135 | 0.63771 |
4a01c70ad20038568712260355c5c0200d7d6187 | 379 | py | Python | materials/sp20/hw/hw09/tests/q2_4.py | ds-modules/Deepnote-demo | 548c12ced6cae774ecd0036aa1e8bb833af6472c | [
"BSD-3-Clause"
] | null | null | null | materials/sp20/hw/hw09/tests/q2_4.py | ds-modules/Deepnote-demo | 548c12ced6cae774ecd0036aa1e8bb833af6472c | [
"BSD-3-Clause"
] | null | null | null | materials/sp20/hw/hw09/tests/q2_4.py | ds-modules/Deepnote-demo | 548c12ced6cae774ecd0036aa1e8bb833af6472c | [
"BSD-3-Clause"
] | null | null | null | test = {
'name': 'q2_4',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> 118 < np.mean(bootstrap_mean_based_estimates) < 126
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',... | 16.478261 | 65 | 0.361478 |
4a01ca28d74407355dcc04564275e7698bfa9f2e | 375 | py | Python | myssite/polls/urls.py | hotai1806/web-server-django | 47ff074bce0a192749cb9b246bb700b97cc194d3 | [
"Unlicense"
] | null | null | null | myssite/polls/urls.py | hotai1806/web-server-django | 47ff074bce0a192749cb9b246bb700b97cc194d3 | [
"Unlicense"
] | null | null | null | myssite/polls/urls.py | hotai1806/web-server-django | 47ff074bce0a192749cb9b246bb700b97cc194d3 | [
"Unlicense"
] | null | null | null | from django.urls import path
from . import views
app_name = "polls"
urlpatterns = [
# # ex: /polls/5/vote/
path('', views.IndexView.as_view(), name='index'),
path('<int:question_id>/vote/', views.vote, name='vote'),
path('<int:pk>',views.DetailView.as_view(),name ='detail'),
path('<int:pk>/results... | 28.846154 | 74 | 0.637333 |
4a01ca2f25f5df0f4142049dae8c84c0f786d873 | 20,232 | py | Python | fewshot_re_kit/multiadversarial_framework.py | snji-khjuria/RelationClassificationFewShotModels | a5047f44a57a81ab3281bf1290fa149a4c456486 | [
"MIT"
] | null | null | null | fewshot_re_kit/multiadversarial_framework.py | snji-khjuria/RelationClassificationFewShotModels | a5047f44a57a81ab3281bf1290fa149a4c456486 | [
"MIT"
] | null | null | null | fewshot_re_kit/multiadversarial_framework.py | snji-khjuria/RelationClassificationFewShotModels | a5047f44a57a81ab3281bf1290fa149a4c456486 | [
"MIT"
] | null | null | null | import os
import sklearn.metrics
import numpy as np
import sys
import time
from . import sentence_encoder
from . import data_loader
import torch
from torch import autograd, optim, nn
from torch.autograd import Variable
from torch.nn import functional as F
from itertools import chain
from numpy.random import uniform
c... | 44.271335 | 184 | 0.564304 |
4a01cb19e48cb06ea6831681ce677d691c2fee27 | 208 | py | Python | sar_objects/__init__.py | goldmanm/atmospheric-sar-comparison | a0d84a27b0fd23a1ed592a6bc859e8d5b054fc47 | [
"MIT"
] | null | null | null | sar_objects/__init__.py | goldmanm/atmospheric-sar-comparison | a0d84a27b0fd23a1ed592a6bc859e8d5b054fc47 | [
"MIT"
] | null | null | null | sar_objects/__init__.py | goldmanm/atmospheric-sar-comparison | a0d84a27b0fd23a1ed592a6bc859e8d5b054fc47 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from atkinson2007 import sar as sar_a
from vereecken2009 import sar as sar_v
from orlando2003 import sar as sar_o
from mereau2000 import sar as sar_m
sars = [sar_a,sar_v,sar_o,sar_m] | 26 | 38 | 0.769231 |
4a01cc86e7227bac8d7a7762643ec704b0b8e337 | 7,223 | py | Python | Python scripts/Rookie/pathing.py | shartrooper/My-python-scripts | 5c3a8db4ed9a75bd9ab4b29153a788d9e6c5d28c | [
"MIT"
] | null | null | null | Python scripts/Rookie/pathing.py | shartrooper/My-python-scripts | 5c3a8db4ed9a75bd9ab4b29153a788d9e6c5d28c | [
"MIT"
] | null | null | null | Python scripts/Rookie/pathing.py | shartrooper/My-python-scripts | 5c3a8db4ed9a75bd9ab4b29153a788d9e6c5d28c | [
"MIT"
] | null | null | null | from pathlib import Path
myFiles = ['accounts.txt', 'details.csv', 'invite.docx']
for filename in myFiles:
print(Path(r'C:\Users\Al', filename))
#C:\Users\Al\accounts.txt
#C:\Users\Al\details.csv
#C:\Users\Al\invite.docx
Path('spam', 'bacon', 'eggs')
#WindowsPath('spam/bacon/eggs')
str(Path('sp... | 29.125 | 164 | 0.684065 |
4a01cc8e250b59a0b35cb25434c70589866d9d5e | 28,702 | py | Python | sqlite_utils/cli.py | tomviner/sqlite-utils | 367082e787101fb90901ef3214804ab23a92ce46 | [
"Apache-2.0"
] | 1 | 2020-09-26T23:57:02.000Z | 2020-09-26T23:57:02.000Z | sqlite_utils/cli.py | simonwiles/sqlite-utils | 367082e787101fb90901ef3214804ab23a92ce46 | [
"Apache-2.0"
] | null | null | null | sqlite_utils/cli.py | simonwiles/sqlite-utils | 367082e787101fb90901ef3214804ab23a92ce46 | [
"Apache-2.0"
] | null | null | null | import base64
import click
from click_default_group import DefaultGroup
from datetime import datetime
import hashlib
import pathlib
import sqlite_utils
from sqlite_utils.db import AlterError
import itertools
import json
import sys
import csv as csv_std
import tabulate
from .utils import sqlite3, decode_base64_values
V... | 28.16683 | 107 | 0.596927 |
4a01cc9bdb42270ace4a7aa0dc2b78940a2450b0 | 10,744 | py | Python | newcomers_guide/tests/test_review_data.py | DarwishMenna/pathways-backend | e9825e0373c586ce8f07ee8b70aecc7de679fb41 | [
"BSD-3-Clause"
] | 12 | 2017-08-30T18:21:00.000Z | 2021-12-09T04:04:17.000Z | newcomers_guide/tests/test_review_data.py | DarwishMenna/pathways-backend | e9825e0373c586ce8f07ee8b70aecc7de679fb41 | [
"BSD-3-Clause"
] | 424 | 2017-08-08T18:32:14.000Z | 2022-03-30T21:42:51.000Z | newcomers_guide/tests/test_review_data.py | DarwishMenna/pathways-backend | e9825e0373c586ce8f07ee8b70aecc7de679fb41 | [
"BSD-3-Clause"
] | 7 | 2017-09-29T21:14:37.000Z | 2019-12-30T21:07:37.000Z | from django.test import TestCase
from utility.review_data import compare_data, partition_files
class PartitionFilesForReview(TestCase):
def test_includes_file_in_reference_language(self):
result = partition_files('en', 'fr', {
'somePath': ['en.content.md', 'fr.content.md'],
})
... | 43.497976 | 100 | 0.671258 |
4a01cd396f5f5f97b51ed2201dc1895ce7d7b21a | 2,764 | py | Python | Tools/c-analyzer/c_analyzer/__init__.py | mshumko/cpython | c0590c0033e86f98cdf5f2ca6898656f98ab4053 | [
"0BSD"
] | 4 | 2020-11-28T08:49:09.000Z | 2020-12-13T03:43:55.000Z | Tools/c-analyzer/c_analyzer/__init__.py | mshumko/cpython | c0590c0033e86f98cdf5f2ca6898656f98ab4053 | [
"0BSD"
] | 12 | 2020-12-01T05:40:22.000Z | 2022-03-01T18:00:53.000Z | Tools/c-analyzer/c_analyzer/__init__.py | mshumko/cpython | c0590c0033e86f98cdf5f2ca6898656f98ab4053 | [
"0BSD"
] | null | null | null | from c_parser import (
parse_files as _parse_files,
)
from c_parser.info import (
KIND,
TypeDeclaration,
filter_by_kind,
collate_by_kind_group,
resolve_parsed,
)
from . import (
analyze as _analyze,
datafiles as _datafiles,
)
from .info import Analysis
def analyze(filenmes, **kwargs):
... | 26.576923 | 71 | 0.573444 |
4a01cd40d102946142d7649191bc4c11f8bf230e | 443 | py | Python | sedldata/migrate/versions/954def4c1b92_identifier_for_data_load.py | OpenDataServices/sedldata | c7f3b13969bb9c9a494a5fadf1456cc85e9bf2cc | [
"BSD-3-Clause"
] | null | null | null | sedldata/migrate/versions/954def4c1b92_identifier_for_data_load.py | OpenDataServices/sedldata | c7f3b13969bb9c9a494a5fadf1456cc85e9bf2cc | [
"BSD-3-Clause"
] | null | null | null | sedldata/migrate/versions/954def4c1b92_identifier_for_data_load.py | OpenDataServices/sedldata | c7f3b13969bb9c9a494a5fadf1456cc85e9bf2cc | [
"BSD-3-Clause"
] | 1 | 2019-01-20T19:39:11.000Z | 2019-01-20T19:39:11.000Z | """identifier for data load
Revision ID: 954def4c1b92
Revises: 601c0b812f50
Create Date: 2018-08-22 13:56:11.419775
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '954def4c1b92'
down_revision = '601c0b812f50'
branch_labels = None
depends_on = None
def upgrad... | 17.72 | 58 | 0.735892 |
4a01cd779e19d62891c24dd75df5c97f5016849f | 549 | py | Python | languages/models.py | bastoune57/gokiting_back_end | f3edcbeede292713349b28f2390b5d57e1420f8e | [
"MIT"
] | null | null | null | languages/models.py | bastoune57/gokiting_back_end | f3edcbeede292713349b28f2390b5d57e1420f8e | [
"MIT"
] | null | null | null | languages/models.py | bastoune57/gokiting_back_end | f3edcbeede292713349b28f2390b5d57e1420f8e | [
"MIT"
] | null | null | null | from django.db import models
from .fields import LanguageField
# Create your models here.
class Language (models.Model):
"""
Language model (move to Language app)
"""
user = models.ForeignKey(
'instructors.User',
on_delete=models.CASCADE,
blank=False,
related_name='lang... | 24.954545 | 57 | 0.639344 |
4a01ce0f082c4036e643a52aae0a64ca444f8803 | 15,002 | py | Python | projects/image_chat/transresnet_multimodal/transresnet_multimodal.py | harunpehlivan/ParlAI | e1f2942feb8f158964477f4a46bc2c4c741b2ccd | [
"MIT"
] | 1 | 2019-07-25T17:30:18.000Z | 2019-07-25T17:30:18.000Z | projects/image_chat/transresnet_multimodal/transresnet_multimodal.py | abisee/ParlAI | 5507d4745ca23b23af311673a6b0d1b7e72eb5cd | [
"MIT"
] | null | null | null | projects/image_chat/transresnet_multimodal/transresnet_multimodal.py | abisee/ParlAI | 5507d4745ca23b23af311673a6b0d1b7e72eb5cd | [
"MIT"
] | 1 | 2019-07-28T14:53:18.000Z | 2019-07-28T14:53:18.000Z | #!/usr/bin/env python3
# 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.
"""Transresnet Multimodal Model (https://arxiv.org/abs/1811.00945)."""
from parlai.core.dict import DictionaryAgent
from... | 35.804296 | 91 | 0.571724 |
4a01ce183f8b50647ceafa95cd72c53c90edab8e | 8,031 | py | Python | spacy/tests/pipeline/test_entity_ruler.py | lyq0930/spaCy | d030e04c235c2c16916fe66ed5892158c21fd245 | [
"BSD-3-Clause",
"MIT"
] | 1 | 2020-09-27T13:51:57.000Z | 2020-09-27T13:51:57.000Z | spacy/tests/pipeline/test_entity_ruler.py | lyq0930/spaCy | d030e04c235c2c16916fe66ed5892158c21fd245 | [
"BSD-3-Clause",
"MIT"
] | 1 | 2021-06-22T13:32:07.000Z | 2021-06-23T09:15:29.000Z | spacy/tests/pipeline/test_entity_ruler.py | ezorita/spaCy | 66f1d29b4effb0b355268832fdcff21c279658bc | [
"BSD-3-Clause",
"MIT"
] | null | null | null | import pytest
from spacy import registry
from spacy.tokens import Span
from spacy.language import Language
from spacy.pipeline import EntityRuler
from spacy.errors import MatchPatternError
from thinc.api import NumpyOps, get_current_ops
@pytest.fixture
def nlp():
return Language()
@pytest.fixture
@registry.mis... | 33.4625 | 82 | 0.668161 |
4a01ce51ca39f28a98688626d52c733891c44ef1 | 2,991 | py | Python | wemake_python_styleguide/visitors/ast/complexity/nested.py | makarchuk/wemake-python-styleguide | f976eed24613fbd6ea29f1cc589d8f863165a7aa | [
"MIT"
] | null | null | null | wemake_python_styleguide/visitors/ast/complexity/nested.py | makarchuk/wemake-python-styleguide | f976eed24613fbd6ea29f1cc589d8f863165a7aa | [
"MIT"
] | null | null | null | wemake_python_styleguide/visitors/ast/complexity/nested.py | makarchuk/wemake-python-styleguide | f976eed24613fbd6ea29f1cc589d8f863165a7aa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import ast
from typing import ClassVar
from wemake_python_styleguide.constants import (
NESTED_CLASSES_WHITELIST,
NESTED_FUNCTIONS_WHITELIST,
)
from wemake_python_styleguide.types import AnyFunctionDef, AnyNodes, final
from wemake_python_styleguide.violations.best_practices import (
... | 30.835052 | 78 | 0.693748 |
4a01cefe757b9d583a8081a8083840161a303937 | 11,014 | py | Python | src/lti/tool_config.py | revsys/lti | 0df2470126a88b0c642de209cc2ff6388b657557 | [
"MIT"
] | 1 | 2018-03-28T05:42:48.000Z | 2018-03-28T05:42:48.000Z | src/lti/tool_config.py | revsys/lti | 0df2470126a88b0c642de209cc2ff6388b657557 | [
"MIT"
] | 1 | 2018-03-28T06:02:44.000Z | 2018-03-28T06:02:44.000Z | src/elti/tool_config.py | CaptainAchilles/lti | cf8df0c8115d7e0dd02b4c87376db2b87d3726d7 | [
"MIT"
] | 2 | 2018-03-28T05:52:46.000Z | 2020-06-05T00:53:43.000Z | from collections import defaultdict
from lxml import etree, objectify
from .utils import InvalidLTIConfigError
VALID_ATTRIBUTES = [
'title',
'description',
'launch_url',
'secure_launch_url',
'icon',
'secure_icon',
'cartridge_bundle',
'cartridge_icon',
'vendor_code',
'vendor_nam... | 38.376307 | 479 | 0.516797 |
4a01cfe44a15d157be41d37b367cd1564f18b3f9 | 917 | py | Python | apps/tasks/urls.py | Sravanksk/fyle-qbo-api | 53f595170a073f245b9930bfce2ca07bdf998ce3 | [
"MIT"
] | null | null | null | apps/tasks/urls.py | Sravanksk/fyle-qbo-api | 53f595170a073f245b9930bfce2ca07bdf998ce3 | [
"MIT"
] | null | null | null | apps/tasks/urls.py | Sravanksk/fyle-qbo-api | 53f595170a073f245b9930bfce2ca07bdf998ce3 | [
"MIT"
] | null | null | null | """fyle_qbo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | 36.68 | 87 | 0.718648 |
4a01d06f5195438416debbf98d914807536e8b31 | 36 | py | Python | backups/__init__.py | daqbroker/daqbrokerServer | e8d2b72b4e3ab12c26dfa7b52e9d77097ede3f33 | [
"MIT"
] | null | null | null | backups/__init__.py | daqbroker/daqbrokerServer | e8d2b72b4e3ab12c26dfa7b52e9d77097ede3f33 | [
"MIT"
] | null | null | null | backups/__init__.py | daqbroker/daqbrokerServer | e8d2b72b4e3ab12c26dfa7b52e9d77097ede3f33 | [
"MIT"
] | null | null | null | from .rsyncServer import rsyncServer | 36 | 36 | 0.888889 |
4a01d2787e7eab53b55121d2fdd302121768a482 | 391 | py | Python | Gallery/wsgi.py | willardsigei/P-Gallery | e2d2de52616eb133cd1bb209f179e57272ab5527 | [
"MIT"
] | null | null | null | Gallery/wsgi.py | willardsigei/P-Gallery | e2d2de52616eb133cd1bb209f179e57272ab5527 | [
"MIT"
] | null | null | null | Gallery/wsgi.py | willardsigei/P-Gallery | e2d2de52616eb133cd1bb209f179e57272ab5527 | [
"MIT"
] | null | null | null | """
WSGI config for Gallery 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/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 24.4375 | 78 | 0.787724 |
4a01d29f3f096d62b7e12ffd227ab20a3adbdf70 | 24,893 | py | Python | src/aiocasambi/unit.py | hellqvio86/aiocasambi | 2efd61ed8f8425f3a4a5b257f3addb3face5a185 | [
"MIT"
] | 7 | 2020-06-14T20:43:29.000Z | 2021-09-30T23:36:09.000Z | src/aiocasambi/unit.py | hellqvio86/aiocasambi | 2efd61ed8f8425f3a4a5b257f3addb3face5a185 | [
"MIT"
] | 2 | 2022-01-04T12:59:06.000Z | 2022-01-07T09:46:13.000Z | src/aiocasambi/unit.py | hellqvio86/aiocasambi | 2efd61ed8f8425f3a4a5b257f3addb3face5a185 | [
"MIT"
] | 5 | 2020-06-14T19:12:37.000Z | 2022-01-03T12:42:46.000Z | """State representation of Casanbi Unit"""
import logging
import re
from pprint import pformat
from typing import Tuple, Union
from colorsys import rgb_to_hsv
from .errors import AiocasambiException
LOGGER = logging.getLogger(__name__)
UNIT_STATE_OFF = "off"
UNIT_STATE_ON = "on"
class Unit:
"""Represents a ... | 28.579793 | 111 | 0.496003 |
4a01d30c6bb9a136bf26ad187630bb8e8b30a50c | 6,846 | py | Python | core/migrations/0001_initial.py | luisza/vcl_django | 43d04f7951cb8805502e51f6f6360c7ec63215cc | [
"Apache-2.0"
] | null | null | null | core/migrations/0001_initial.py | luisza/vcl_django | 43d04f7951cb8805502e51f6f6360c7ec63215cc | [
"Apache-2.0"
] | null | null | null | core/migrations/0001_initial.py | luisza/vcl_django | 43d04f7951cb8805502e51f6f6360c7ec63215cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-02 07:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | 39.802326 | 163 | 0.513877 |
4a01d37056c1dd5f4d245a6c3159ff9aaaadc252 | 12,995 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/fortios/fortios_system_resource_limits.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/fortios/fortios_system_resource_limits.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 32 | 2018-10-09T04:13:42.000Z | 2020-05-11T07:20:28.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/fortios/fortios_system_resource_limits.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 11 | 2018-10-09T00:14:53.000Z | 2021-11-03T10:54:09.000Z | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | 32.732997 | 128 | 0.587072 |
4a01d4e5c75d44d7afd9fa10688cd5ec3b5afd9b | 20,919 | py | Python | Lib/test/test_scope.py | Space0726/RustPython | 7a89a4bcfddfaac8560bdb33d53621e1639b2e70 | [
"MIT"
] | null | null | null | Lib/test/test_scope.py | Space0726/RustPython | 7a89a4bcfddfaac8560bdb33d53621e1639b2e70 | [
"MIT"
] | null | null | null | Lib/test/test_scope.py | Space0726/RustPython | 7a89a4bcfddfaac8560bdb33d53621e1639b2e70 | [
"MIT"
] | null | null | null | import unittest
import weakref
from test.support import check_syntax_error, cpython_only
class ScopeTests(unittest.TestCase):
def testSimpleNesting(self):
def make_adder(x):
def adder(y):
return x + y
return adder
inc = make_adder(1)
plus10 ... | 26.513308 | 84 | 0.455184 |
4a01d53b8d6eef419134054b8fcda2bcfc75c974 | 3,009 | py | Python | VISUALIZE/examples/nb_nbody_specials.py | binary-husky/hmp2g | 1a4f4093cd296f07348f4db4c7503aca6e1fb05c | [
"MIT"
] | 2 | 2022-02-25T12:04:55.000Z | 2022-03-15T02:37:59.000Z | VISUALIZE/examples/nb_nbody_specials.py | binary-husky/hmp2g | 1a4f4093cd296f07348f4db4c7503aca6e1fb05c | [
"MIT"
] | null | null | null | VISUALIZE/examples/nb_nbody_specials.py | binary-husky/hmp2g | 1a4f4093cd296f07348f4db4c7503aca6e1fb05c | [
"MIT"
] | null | null | null | import numpy as np
import random, time
from scipy.integrate import ode
from UTILS.tensor_ops import distance_matrix, repeat_at, delta_matrix
from VISUALIZE.mcom import mcom
PI = np.pi
def run():
# 可视化界面初始化
可视化桥 = mcom(path='RECYCLE/v2d_logger/', draw_mode='Threejs')
可视化桥.初始化3D(); 可视化桥.设置样式('star')
... | 34.988372 | 166 | 0.516451 |
4a01d719be3b849f7b66da421089b7d6d90de1d3 | 669 | py | Python | Python/Closures and Decorators/Decorators 2 - Name Directory.py | guptamadhur/HackerRank | e0f1ba82296eea88d2b34132d3b1a28cd67ffa03 | [
"MIT"
] | null | null | null | Python/Closures and Decorators/Decorators 2 - Name Directory.py | guptamadhur/HackerRank | e0f1ba82296eea88d2b34132d3b1a28cd67ffa03 | [
"MIT"
] | null | null | null | Python/Closures and Decorators/Decorators 2 - Name Directory.py | guptamadhur/HackerRank | e0f1ba82296eea88d2b34132d3b1a28cd67ffa03 | [
"MIT"
] | null | null | null | # Author: Madhur Gupta
# Github: github.com/guptamadhur
# Project: Hacker Rank Practice Python
# Sample Input
#
# 3
# Mike Thomson 20 M
# Robert Bustle 32 M
# Andria Bustle 30 F
# Sample Output
#
# Mr. Mike Thomson
# Ms. Andria Bustle
# Mr. Robert Bustle
import operator
def age(x):
return int(x[2])
def person_... | 19.676471 | 81 | 0.650224 |
4a01d7849121011178bd3a0d5a767fd9f9b3505e | 579 | py | Python | spotify_search/spotify_api.py | MiltonLn/spotify-tracks-pyconco2020 | 4a75b15852344f7dac066bea3c3e3abb1157d198 | [
"MIT"
] | 1 | 2021-07-29T16:09:30.000Z | 2021-07-29T16:09:30.000Z | spotify_search/spotify_api.py | MiltonLn/spotify-tracks-pyconco2020 | 4a75b15852344f7dac066bea3c3e3abb1157d198 | [
"MIT"
] | null | null | null | spotify_search/spotify_api.py | MiltonLn/spotify-tracks-pyconco2020 | 4a75b15852344f7dac066bea3c3e3abb1157d198 | [
"MIT"
] | null | null | null | import os
import requests
BASE_URL = "https://api.spotify.com/v1"
AUTH_TOKEN = os.getenv("SPOTIFY_AUTH_TOKEN")
def get_spotify_response(search_term, limit=None, search_type=None):
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": f"Bearer {AU... | 22.269231 | 68 | 0.632124 |
4a01d8de083e651f9521b9396379d64ac1e39876 | 28,480 | py | Python | test/with_dummyserver/test_https.py | benjaminp/urllib3 | 62ef68e49edf5dabde26732a154d0e925cef7301 | [
"MIT"
] | null | null | null | test/with_dummyserver/test_https.py | benjaminp/urllib3 | 62ef68e49edf5dabde26732a154d0e925cef7301 | [
"MIT"
] | null | null | null | test/with_dummyserver/test_https.py | benjaminp/urllib3 | 62ef68e49edf5dabde26732a154d0e925cef7301 | [
"MIT"
] | null | null | null | import datetime
import json
import logging
import ssl
import sys
import shutil
import warnings
import mock
import pytest
from dummyserver.testcase import HTTPSDummyServerTestCase, IPV6HTTPSDummyServerTestCase
from dummyserver.server import (
CLIENT_CERT,
CLIENT_INTERMEDIATE_PEM,
CLIENT_NO_INTERMEDIATE_PEM... | 37.035111 | 88 | 0.587956 |
4a01da108fbba1954570581b20ae0af114c97d8f | 2,001 | py | Python | GUI/GtkGI/Applications.py | gcewing/PyGUI | 58c6c38ccb8e66acdf98dea6b24bef1d9a03147c | [
"MIT"
] | 9 | 2019-07-15T19:03:27.000Z | 2021-11-24T19:50:02.000Z | GUI/GtkGI/Applications.py | mnabeelp/PyGUI | 58c6c38ccb8e66acdf98dea6b24bef1d9a03147c | [
"MIT"
] | 3 | 2019-09-11T13:22:10.000Z | 2020-08-19T20:13:00.000Z | GUI/GtkGI/Applications.py | mnabeelp/PyGUI | 58c6c38ccb8e66acdf98dea6b24bef1d9a03147c | [
"MIT"
] | 4 | 2020-02-23T16:50:06.000Z | 2022-02-10T07:15:35.000Z | #
# Python GUI - Application class - Gtk
#
import sys
from gi.repository import Gtk, Gdk
from GUI.Globals import application
from GUI.GApplications import Application as GApplication
class Application(GApplication):
_in_gtk_main = 0
def run(self):
GApplication.run(self)
def set_menus(self, menu_list):
GApp... | 24.703704 | 79 | 0.689155 |
4a01db9c0ba8c0ffc15524da90e21c23dc743e9f | 7,110 | py | Python | tests/chainer_tests/functions_tests/connection_tests/test_dilated_convolution_2d.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | 7 | 2017-05-08T07:02:40.000Z | 2018-12-02T18:35:39.000Z | tests/chainer_tests/functions_tests/connection_tests/test_dilated_convolution_2d.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | null | null | null | tests/chainer_tests/functions_tests/connection_tests/test_dilated_convolution_2d.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | null | null | null | import unittest
import mock
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer.functions.connection import dilated_convolution_2d
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testin... | 35.728643 | 77 | 0.611533 |
4a01dcbaabb698b9a9974cc29fdb37a240de8d90 | 7,677 | py | Python | blueprints/genome_search.py | Ensembl/ensembl-2020-genome-search | ed0877ee3eedac135ac84809e9c44429a758ac82 | [
"Apache-2.0"
] | 2 | 2020-02-06T13:25:53.000Z | 2020-07-31T05:34:39.000Z | blueprints/genome_search.py | Ensembl/ensembl-2020-genome-search | ed0877ee3eedac135ac84809e9c44429a758ac82 | [
"Apache-2.0"
] | 15 | 2019-07-09T16:30:13.000Z | 2021-10-06T10:30:10.000Z | blueprints/genome_search.py | Ensembl/ensembl-2020-genome-search | ed0877ee3eedac135ac84809e9c44429a758ac82 | [
"Apache-2.0"
] | 3 | 2020-06-23T17:21:37.000Z | 2021-03-26T12:38:43.000Z | """
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | 40.619048 | 152 | 0.621206 |
4a01dcc1e78709b99f149f9bc73b215b59dc3549 | 1,548 | py | Python | SC001/Assignment4/best_photoshop_award.py | elven-liu/stanCode-projects | e42f84d3b7bb7422e8d755d9e81cb24cc5625670 | [
"MIT"
] | null | null | null | SC001/Assignment4/best_photoshop_award.py | elven-liu/stanCode-projects | e42f84d3b7bb7422e8d755d9e81cb24cc5625670 | [
"MIT"
] | null | null | null | SC001/Assignment4/best_photoshop_award.py | elven-liu/stanCode-projects | e42f84d3b7bb7422e8d755d9e81cb24cc5625670 | [
"MIT"
] | null | null | null | """
File: best_photoshop_award.py
----------------------------------
This file creates a photoshopped image
that is going to compete for the Best
Photoshop Award for SC001.
Please put all the images you will use in the image_contest folder
and make sure to choose the right folder when loading your images.
"""
from simp... | 30.352941 | 96 | 0.656331 |
4a01dcda937fa8a9980d1129747452d02d95d030 | 10,035 | py | Python | core/python/spirit/hamiltonian.py | MSallermann/spirit | d3b771bcbf2f1eb4b28d48899091c17a48f12c67 | [
"MIT"
] | 46 | 2020-08-24T22:40:15.000Z | 2022-02-28T06:54:54.000Z | core/python/spirit/hamiltonian.py | MSallermann/spirit | d3b771bcbf2f1eb4b28d48899091c17a48f12c67 | [
"MIT"
] | null | null | null | core/python/spirit/hamiltonian.py | MSallermann/spirit | d3b771bcbf2f1eb4b28d48899091c17a48f12c67 | [
"MIT"
] | 4 | 2020-09-05T13:24:41.000Z | 2021-11-06T07:46:47.000Z | """
Hamiltonian
====================
Set the parameters of the Heisenberg Hamiltonian, such as external field or exchange interaction.
"""
import spirit.spiritlib as spiritlib
import ctypes
### Load Library
_spirit = spiritlib.load_spirit_library()
### DM vector chirality
CHIRALITY_BLOCH = 1
"""DMI Bloch c... | 48.245192 | 115 | 0.688889 |
4a01dcfbb511321e882d8816fc55bf762a7cd589 | 2,019 | py | Python | src/app/confusion_matrix_calculation_app.py | LiuYuWei/service-structure-data-extract | 6a3d74cfd71e27364dc1cfc8d42787b72e0f738d | [
"Apache-2.0"
] | null | null | null | src/app/confusion_matrix_calculation_app.py | LiuYuWei/service-structure-data-extract | 6a3d74cfd71e27364dc1cfc8d42787b72e0f738d | [
"Apache-2.0"
] | null | null | null | src/app/confusion_matrix_calculation_app.py | LiuYuWei/service-structure-data-extract | 6a3d74cfd71e27364dc1cfc8d42787b72e0f738d | [
"Apache-2.0"
] | null | null | null | """Confusion matrix calculation app."""
# coding=utf-8
# import relation package.
# import project package.
from config.config_setting import ConfigSetting
from src.service.confusion_matrix_calculation_service import ConfusionMatrixCalculationService
class ConfusionMatrixCalculationApp:
"""Confusion matrix calcu... | 39.588235 | 94 | 0.747895 |
4a01dd326d90f2d2c58ad325933bdbb91d8ca582 | 257 | py | Python | WikiTerms/getterms.py | SIREN-DST/SeedURLWork | 6e74adbf584bdf5a2fdfb4ac258af124917ea2c6 | [
"MIT"
] | null | null | null | WikiTerms/getterms.py | SIREN-DST/SeedURLWork | 6e74adbf584bdf5a2fdfb4ac258af124917ea2c6 | [
"MIT"
] | null | null | null | WikiTerms/getterms.py | SIREN-DST/SeedURLWork | 6e74adbf584bdf5a2fdfb4ac258af124917ea2c6 | [
"MIT"
] | 2 | 2019-05-01T08:31:32.000Z | 2020-06-28T14:33:19.000Z | f=open('NIST.IR.7298r2.txt')
g=open('terms','w')
i=0
for line in f:
k=''
s=line.decode('utf-8').strip()
if i==0:
c=s[-1]
print c
i+=1
for j in line:
try:
k+=j.encode('utf-8')
except:
if s[-1]==c:
g.write(k)
g.write('\n')
break | 14.277778 | 31 | 0.521401 |
4a01dd48f27d2b0bb1465f87503ecc6edd2cc9a0 | 387 | py | Python | cride/circles/migrations/0005_auto_20190227_2238.py | mpita/cride | 5e8afb710d3ac704c9c3819e0f7ff762e60948ff | [
"MIT"
] | 1 | 2019-04-09T07:15:46.000Z | 2019-04-09T07:15:46.000Z | cride/circles/migrations/0005_auto_20190227_2238.py | mpita/cride | 5e8afb710d3ac704c9c3819e0f7ff762e60948ff | [
"MIT"
] | 7 | 2020-06-05T19:54:39.000Z | 2022-03-11T23:41:06.000Z | cride/circles/migrations/0005_auto_20190227_2238.py | mpita/cride | 5e8afb710d3ac704c9c3819e0f7ff762e60948ff | [
"MIT"
] | null | null | null | # Generated by Django 2.0.10 on 2019-02-27 22:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('circles', '0004_auto_20190226_2153'),
]
operations = [
migrations.RenameField(
model_name='membership',
old_name='userd_inv... | 20.368421 | 48 | 0.609819 |
4a01dd8acbd5d161fe816414e429e1b875926216 | 825 | py | Python | di/utils/inspection/module_factories/__init__.py | dlski/python-di | 04dcdf58f3cf820e2d2ba5086e4e89822ae1f409 | [
"MIT"
] | 8 | 2021-02-05T16:17:31.000Z | 2022-03-03T00:01:33.000Z | di/utils/inspection/module_factories/__init__.py | dlski/python-di | 04dcdf58f3cf820e2d2ba5086e4e89822ae1f409 | [
"MIT"
] | null | null | null | di/utils/inspection/module_factories/__init__.py | dlski/python-di | 04dcdf58f3cf820e2d2ba5086e4e89822ae1f409 | [
"MIT"
] | null | null | null | from di.utils.inspection.module_factories.base import (
FactoryFilter,
FactoryFilterCascade,
FactoryItem,
)
from di.utils.inspection.module_factories.filters import (
AllFactoryFilter,
InternalsFactoryFilter,
InternalsOrAllFactoryFilter,
NonAbstractFactoryFilter,
NonDataclassFactoryFilte... | 25 | 83 | 0.749091 |
4a01ddd4c6bf6871f305746a700326ae59d3bf7e | 3,134 | py | Python | tracker/filters/ball_kalman_filter.py | RoboCupULaval/TrackBots | 4cf272a32a1933613a904a170d6fe84a9583ee02 | [
"MIT"
] | 1 | 2017-08-21T19:58:00.000Z | 2017-08-21T19:58:00.000Z | tracker/filters/ball_kalman_filter.py | RoboCupULaval/TrackBots | 4cf272a32a1933613a904a170d6fe84a9583ee02 | [
"MIT"
] | null | null | null | tracker/filters/ball_kalman_filter.py | RoboCupULaval/TrackBots | 4cf272a32a1933613a904a170d6fe84a9583ee02 | [
"MIT"
] | 1 | 2020-08-07T01:13:48.000Z | 2020-08-07T01:13:48.000Z | from tracker.filters.kalman_filter import KalmanFilter
import numpy as np
from tracker.constants import BallConst
class BallFilter(KalmanFilter):
INITIAL_CONFIDENCE = BallConst.INITIAL_CONFIDENCE
INITIAL_STATE_COVARIANCE = BallConst.INITIAL_STATE_COVARIANCE
POSITION_PROCESS_COVARIANCE = BallConst.POSIT... | 33.340426 | 89 | 0.619336 |
4a01dfaf1d431a38d03737369b852e8918b49bed | 7,944 | py | Python | classifier/train_model.py | juandiegomarquez/hate-speech-and-offensive-language | 865bb58052f84c132d4830b53ebc9f6034d9e28f | [
"MIT"
] | null | null | null | classifier/train_model.py | juandiegomarquez/hate-speech-and-offensive-language | 865bb58052f84c132d4830b53ebc9f6034d9e28f | [
"MIT"
] | null | null | null | classifier/train_model.py | juandiegomarquez/hate-speech-and-offensive-language | 865bb58052f84c132d4830b53ebc9f6034d9e28f | [
"MIT"
] | null | null | null | # %% [markdown]
# # Hate Speech Model
import pandas as pd
import numpy as np
import pickle
from sklearn.feature_extraction.text import TfidfVectorizer
from nltk import corpus
from sklearn.linear_model import LogisticRegression
from sklearn.feature_selection import SelectFromModel
from sklearn.metrics import classifi... | 31.776 | 117 | 0.64854 |
4a01dfec96e4fc93f17e20190b1db79d7849fedc | 1,774 | py | Python | examples/pybullet/gym/pybullet_envs/deep_mimic/learning/exp_params.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 9,136 | 2015-01-02T00:41:45.000Z | 2022-03-31T15:30:02.000Z | examples/pybullet/gym/pybullet_envs/deep_mimic/learning/exp_params.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 2,424 | 2015-01-05T08:55:58.000Z | 2022-03-30T19:34:55.000Z | examples/pybullet/gym/pybullet_envs/deep_mimic/learning/exp_params.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 2,921 | 2015-01-02T10:19:30.000Z | 2022-03-31T02:48:42.000Z | import json
import numpy as np
import pybullet_utils.math_util as MathUtil
class ExpParams(object):
RATE_KEY = 'Rate'
INIT_ACTION_RATE_KEY = 'InitActionRate'
NOISE_KEY = 'Noise'
NOISE_INTERNAL_KEY = 'NoiseInternal'
TEMP_KEY = 'Temp'
def __init__(self):
self.rate = 0.2
self.init_action_rate = 0
... | 31.678571 | 98 | 0.692221 |
4a01e001a17d48f24c245b508b3ee18cf59e3f01 | 12,068 | py | Python | plugin.py | heggink/domoticz-icloud | a6c68f83e09ae5c8f248892d8ea7433d8aeb3cdd | [
"MIT"
] | 1 | 2018-09-04T06:50:17.000Z | 2018-09-04T06:50:17.000Z | plugin.py | heggink/domoticz-icloud | a6c68f83e09ae5c8f248892d8ea7433d8aeb3cdd | [
"MIT"
] | 2 | 2018-10-29T07:54:46.000Z | 2019-07-02T19:50:17.000Z | plugin.py | heggink/domoticz-icloud | a6c68f83e09ae5c8f248892d8ea7433d8aeb3cdd | [
"MIT"
] | null | null | null | """
<plugin key="AppleDevices" name="Apple iCloud Device Presence" author="heggink" version="0.0.2">
<params>
<param field="Username" label="Apple user name" width="150px" required="true" default="username"/>
<param field="Password" label="Apple Password" width="150px" required="true" default="passw... | 43.1 | 250 | 0.530577 |
4a01e23a5810ba4244de53857502d63622b7e55f | 517 | py | Python | readthedocs/api/v2/proxied_urls.py | tkoyama010/readthedocs.org | aac8fb39586db902d9fbb51b639dd281c819dae2 | [
"MIT"
] | null | null | null | readthedocs/api/v2/proxied_urls.py | tkoyama010/readthedocs.org | aac8fb39586db902d9fbb51b639dd281c819dae2 | [
"MIT"
] | 7 | 2020-07-07T21:17:17.000Z | 2022-01-13T02:31:42.000Z | readthedocs/api/v2/proxied_urls.py | mondeja/readthedocs.org | fb01c6d9d78272e3f4fd146697e8760c04e4fbb6 | [
"MIT"
] | null | null | null | """
Proxied API URLs.
Served from the same domain docs are served,
so they can make use of features that require to have access to their cookies.
"""
from django.conf.urls import include, url
from .views.proxied import ProxiedFooterHTML
from readthedocs.search.proxied_api import ProxiedPageSearchAPIView
api_footer_... | 27.210526 | 79 | 0.775629 |
4a01e2f3168d7493f2ba8487f74f02d739e96d03 | 5,049 | py | Python | Qubie_code/python/robotcontrol.py | OldETC/Bipedal_Qubie | a789ea84ce83c6e135bb55d48fa63464ed958632 | [
"Apache-2.0"
] | null | null | null | Qubie_code/python/robotcontrol.py | OldETC/Bipedal_Qubie | a789ea84ce83c6e135bb55d48fa63464ed958632 | [
"Apache-2.0"
] | null | null | null | Qubie_code/python/robotcontrol.py | OldETC/Bipedal_Qubie | a789ea84ce83c6e135bb55d48fa63464ed958632 | [
"Apache-2.0"
] | null | null | null | """ RobotControl.py
the joints are assigned to two servo driver boards
They start at the top of the chest.
shoulder, bicep, elbow, wrist, claw, hip, thigh, knee, ankelroll anklepitch.
The head nod and turn are in to top two slots for the right side.
"""
""" Apache license"""
"""
Copyright 2020 H. L. H... | 31.55625 | 80 | 0.581303 |
4a01e3ced4559a80cbfb9a9688e71e0bb63f1f75 | 6,842 | py | Python | examples/segregation.py | cash/dworp | b7b0280183d4fa54b65bf5a3d4008bf64b7434dc | [
"BSD-3-Clause"
] | null | null | null | examples/segregation.py | cash/dworp | b7b0280183d4fa54b65bf5a3d4008bf64b7434dc | [
"BSD-3-Clause"
] | null | null | null | examples/segregation.py | cash/dworp | b7b0280183d4fa54b65bf5a3d4008bf64b7434dc | [
"BSD-3-Clause"
] | null | null | null | import argparse
import dworp
import logging
import matplotlib.colors
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
class Household(dworp.Agent):
"""Household agent for Schelling Segregation model"""
def __init__(self, agent_id, color, x, y, similarity):
super().__init__(agen... | 32.894231 | 99 | 0.618971 |
4a01e3df53e47737eb040efc126fb30f853b4be5 | 3,002 | py | Python | ssguan/ignitor/utility/reflect.py | samuelbaizg/ssguan | 97def0609d61e40472554464470758b5fb9eca35 | [
"Apache-2.0"
] | 1 | 2015-07-14T14:24:05.000Z | 2015-07-14T14:24:05.000Z | ssguan/ignitor/utility/reflect.py | samuelbaizg/ssguan | 97def0609d61e40472554464470758b5fb9eca35 | [
"Apache-2.0"
] | null | null | null | ssguan/ignitor/utility/reflect.py | samuelbaizg/ssguan | 97def0609d61e40472554464470758b5fb9eca35 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2015 www.suishouguan.com
#
# Licensed under the Private License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/samuelbaizg/ssguan/blob/master/LICENSE
#
# Unless re... | 28.590476 | 100 | 0.616589 |
4a01e3ffcf08c8fa639deb059ac1f8d196401458 | 6,324 | py | Python | entrypoint.py | vulnbe/openvas-docker | 4d9e56a3feebe240d24dc873b2f2b4a14244a320 | [
"MIT"
] | 1 | 2020-02-15T08:46:19.000Z | 2020-02-15T08:46:19.000Z | entrypoint.py | vulnbe/openvas-docker | 4d9e56a3feebe240d24dc873b2f2b4a14244a320 | [
"MIT"
] | null | null | null | entrypoint.py | vulnbe/openvas-docker | 4d9e56a3feebe240d24dc873b2f2b4a14244a320 | [
"MIT"
] | 4 | 2019-10-17T20:09:04.000Z | 2021-10-10T09:47:42.000Z | #!/usr/bin/env python3
import os
import logging
import subprocess
import argparse
from time import sleep
from shlex import quote
from gvm_client import GVM_client, Task
env_ov_passwd = 'OV_PASSWD'
env_ov_run_tasks = 'OV_AUTORUN_TASKS'
env_ov_save_reports = 'OV_AUTOSAVE_REPORTS'
redis_conf = '/etc/openvas-redis.conf'
... | 31.62 | 140 | 0.652435 |
4a01e4fa21d6aced0fe6ab436441be44d677e940 | 244 | py | Python | webportal/webportal.py | sreenut/BlockChain-Framework | 3abfd5420a977573e87e3f0afcd3e6354fa4884d | [
"MIT"
] | 8 | 2018-07-18T17:49:41.000Z | 2022-03-17T01:30:44.000Z | webportal/webportal.py | sreenut/BlockChain-Framework | 3abfd5420a977573e87e3f0afcd3e6354fa4884d | [
"MIT"
] | null | null | null | webportal/webportal.py | sreenut/BlockChain-Framework | 3abfd5420a977573e87e3f0afcd3e6354fa4884d | [
"MIT"
] | 1 | 2018-09-05T07:11:25.000Z | 2018-09-05T07:11:25.000Z | from app import create_app, db
from app.models import User, MultichainNode, EthTx
app = create_app()
@app.shell_context_processor
def make_shell_context():
return {'db': db, 'User': User, 'MultichainNode': MultichainNode, 'EthTx': EthTx}
| 27.111111 | 85 | 0.75 |
4a01e56ab91ea2d835427131c742fd73c336dfec | 1,976 | py | Python | fastreid/modeling/base_module.py | X-funbean/fast-reid | 97ef9608ba696d116fafb3a8746842b8d0cf546e | [
"Apache-2.0"
] | null | null | null | fastreid/modeling/base_module.py | X-funbean/fast-reid | 97ef9608ba696d116fafb3a8746842b8d0cf546e | [
"Apache-2.0"
] | null | null | null | fastreid/modeling/base_module.py | X-funbean/fast-reid | 97ef9608ba696d116fafb3a8746842b8d0cf546e | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
from ..utils.events import get_event_storage
class BaseModule(nn.Module):
"""
A base Module for ReID models
"""
def __init__(self, cfg):
super().__init__()
self._cfg = cfg
assert len(cfg.MODEL.PIXEL_MEAN) == len(cfg.MODEL.PIXEL_STD)
se... | 31.870968 | 84 | 0.59666 |
4a01e5aa021549d1d0b039cc328d3f2935f46679 | 2,249 | py | Python | uasparser2/imcache.py | redbrickmedia/uasparser2 | 13be6b361a4eba148341ca905c0a5d1c761e6411 | [
"BSD-3-Clause"
] | 16 | 2015-01-13T12:13:16.000Z | 2021-03-09T15:11:36.000Z | uasparser2/imcache.py | redbrickmedia/uasparser2 | 13be6b361a4eba148341ca905c0a5d1c761e6411 | [
"BSD-3-Clause"
] | 1 | 2015-04-28T12:55:01.000Z | 2017-10-12T20:47:09.000Z | uasparser2/imcache.py | redbrickmedia/uasparser2 | 13be6b361a4eba148341ca905c0a5d1c761e6411 | [
"BSD-3-Clause"
] | 5 | 2015-08-07T12:51:47.000Z | 2020-01-05T22:56:21.000Z | """
In-memory caching module
Fast
Insert and get <= O(log n)
Powerful
Thread safe
Global and per key ttl
Size limit with LRU
Simple
Decorator with custom caching keys (TODO)
"""
import time
from threading import Lock
try:
from collections import OrderedDict
except ImportEr... | 24.445652 | 72 | 0.582926 |
4a01e8c22611a0bc96a100279b28c933c9fc3e4f | 1,213 | py | Python | bot.py | sgregg85/QuoteBot | 3f8e3adc417e7286921f2c301ec444c86fb4b247 | [
"Unlicense"
] | null | null | null | bot.py | sgregg85/QuoteBot | 3f8e3adc417e7286921f2c301ec444c86fb4b247 | [
"Unlicense"
] | null | null | null | bot.py | sgregg85/QuoteBot | 3f8e3adc417e7286921f2c301ec444c86fb4b247 | [
"Unlicense"
] | null | null | null | import key #key.py file with keys from twitter
import tweepy
import requests
import json
import time
import random
auth = tweepy.OAuthHandler(key.consumer_key, key.consumer_secret)
auth.set_access_token(key.access_token, key.access_token_secret)
api = tweepy.API(auth)
def getQuote():
url = 'http://api.forismatic.co... | 25.808511 | 90 | 0.70981 |
4a01e97ef7ac42ab5c653f6395a73887807726b1 | 1,198 | py | Python | phns/utils/phn.py | DeepLenin/phns | 80fb48d032cd159782a5d96724e91540a55271ef | [
"MIT"
] | 5 | 2020-04-03T20:59:46.000Z | 2020-07-08T17:40:40.000Z | phns/utils/phn.py | DeepLenin/phns | 80fb48d032cd159782a5d96724e91540a55271ef | [
"MIT"
] | null | null | null | phns/utils/phn.py | DeepLenin/phns | 80fb48d032cd159782a5d96724e91540a55271ef | [
"MIT"
] | null | null | null | class Phn:
PHONEMES = {}
def __new__(cls, val):
if isinstance(val, Phn):
return val
_phn = val.lower().replace("0", "")
if _phn not in cls.PHONEMES:
instance = super(Phn, cls).__new__(cls)
instance.__custom_init__(_phn)
cls.PHONEMES[_phn] ... | 26.043478 | 59 | 0.558431 |
4a01e9d2f2555469f65149920674d9c3906d0537 | 10,075 | py | Python | apps/authentication/api/tests/signup_tests.py | Nicolaad/onlineweb4 | 5942eaf907d6824d5384147627def9edefdb9946 | [
"MIT"
] | null | null | null | apps/authentication/api/tests/signup_tests.py | Nicolaad/onlineweb4 | 5942eaf907d6824d5384147627def9edefdb9946 | [
"MIT"
] | null | null | null | apps/authentication/api/tests/signup_tests.py | Nicolaad/onlineweb4 | 5942eaf907d6824d5384147627def9edefdb9946 | [
"MIT"
] | null | null | null | from django.core import mail
from django.urls import reverse
from django_dynamic_fixture import G
from onlineweb4.fields.recaptcha import mock_validate_recaptcha
from rest_framework import status
from apps.authentication.models import OnlineUser as User
from apps.authentication.models import RegisterToken
from apps.on... | 38.162879 | 88 | 0.659553 |
4a01ed411251ff5235e234f60b7cd6441594ef5b | 28,151 | py | Python | perses/tests/test_relative.py | hannahbrucemacdonald/perses | 6b43d200501e587b352dce5aaefef38e4145048b | [
"MIT"
] | null | null | null | perses/tests/test_relative.py | hannahbrucemacdonald/perses | 6b43d200501e587b352dce5aaefef38e4145048b | [
"MIT"
] | null | null | null | perses/tests/test_relative.py | hannahbrucemacdonald/perses | 6b43d200501e587b352dce5aaefef38e4145048b | [
"MIT"
] | null | null | null | ###########################################
# IMPORTS
###########################################
from simtk.openmm import app
from simtk import unit, openmm
import numpy as np
import os
from nose.tools import nottest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from perses.a... | 49.824779 | 298 | 0.73802 |
4a01ed9991fec5fbb21754f21d0bde97d71a3959 | 10,096 | py | Python | _setup/py2/make/_make.py | urbaniak/rjsmin | 50edd2fbf3a4fcd75dc579cdde416927aef9124f | [
"Apache-2.0"
] | 11 | 2016-09-14T21:59:47.000Z | 2019-01-28T21:58:15.000Z | _setup/py2/make/_make.py | openstack/deb-python-rcssmin | eda03a6cb109deed481e0bc31811e775e96c9d5e | [
"Apache-2.0"
] | null | null | null | _setup/py2/make/_make.py | openstack/deb-python-rcssmin | eda03a6cb109deed481e0bc31811e775e96c9d5e | [
"Apache-2.0"
] | null | null | null | # -*- coding: ascii -*-
#
# Copyright 2007, 2008, 2009, 2010, 2011
# Andr\xe9 Malo or his licensors, as applicable
#
# 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.or... | 29.781711 | 78 | 0.512183 |
4a01edb012c6bb0ab5a64538417ecd8391351849 | 391 | py | Python | compiled/construct/switch_else_only.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 4 | 2017-04-08T12:55:11.000Z | 2020-12-05T21:09:31.000Z | compiled/construct/switch_else_only.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 7 | 2018-04-23T01:30:33.000Z | 2020-10-30T23:56:14.000Z | compiled/construct/switch_else_only.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 6 | 2017-04-08T11:41:14.000Z | 2020-10-30T22:47:31.000Z | from construct import *
from construct.lib import *
switch_else_only__data = Struct(
'value' / FixedSized(4, GreedyBytes),
)
switch_else_only = Struct(
'opcode' / Int8sb,
'prim_byte' / Switch(this.opcode, {}, default=Int8sb),
'indicator' / FixedSized(4, GreedyBytes),
'ut' / Switch(this.indicator, {}, default=Laz... | 24.4375 | 86 | 0.734015 |
4a01eeff6c492a3e7ffb6034acd26210d81d8655 | 1,437 | py | Python | 2017/quals/2017-re-johnny-boy/chall/generate_image.py | tonghuaroot/google-ctf | 46cb7676b4f8e1957bec352e76fa8f335cee1bd5 | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2017/quals/2017-re-johnny-boy/chall/generate_image.py | tonghuaroot/google-ctf | 46cb7676b4f8e1957bec352e76fa8f335cee1bd5 | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2017/quals/2017-re-johnny-boy/chall/generate_image.py | tonghuaroot/google-ctf | 46cb7676b4f8e1957bec352e76fa8f335cee1bd5 | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/python
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 28.176471 | 74 | 0.663883 |
4a01ef4e3fdca074d9def32111ae87071a765149 | 275 | py | Python | tests/test_merge_the_tools.py | yxtay/code-ex | aabcfd4741067a8515fe75441c10853b5724bc01 | [
"MIT"
] | null | null | null | tests/test_merge_the_tools.py | yxtay/code-ex | aabcfd4741067a8515fe75441c10853b5724bc01 | [
"MIT"
] | null | null | null | tests/test_merge_the_tools.py | yxtay/code-ex | aabcfd4741067a8515fe75441c10853b5724bc01 | [
"MIT"
] | null | null | null | import pytest
from src.merge_the_tools import merge_the_tools
cases = [
("AABCAAADA", 3, ["AB", "CA", "AD"]),
]
@pytest.mark.parametrize("string, k,expected", cases)
def test(string, k, expected):
result = merge_the_tools(string, k)
assert result == expected
| 19.642857 | 53 | 0.68 |
4a01f0a75a11e6b8b86a903aad114c039eab5fec | 2,575 | py | Python | infoblox_netmri/api/remote/models/report_job_run_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/remote/models/report_job_run_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/remote/models/report_job_run_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class ReportJobRunRemote(RemoteModel):
"""
Report Job information for reports that have been run on the system in the past 7 days.
| ``id:`` The internal NetMRI identifier for the report job.
| ``at... | 28.932584 | 115 | 0.560388 |
4a01f0bc3138f2184e600a3be4208dbc386051e5 | 2,414 | py | Python | setup.py | bbc/rd-apmm-python-lib-mediagrains | 84c9de511cc53418c277867eaf143f2cc8730d02 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2018-03-26T23:49:34.000Z | 2021-12-23T10:06:09.000Z | setup.py | bbc/rd-apmm-python-lib-mediagrains | 84c9de511cc53418c277867eaf143f2cc8730d02 | [
"ECL-2.0",
"Apache-2.0"
] | 34 | 2018-03-21T16:45:10.000Z | 2022-03-28T13:27:34.000Z | setup.py | bbc/rd-apmm-python-lib-mediagrains | 84c9de511cc53418c277867eaf143f2cc8730d02 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2018 British Broadcasting Corporation
#
# 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 requir... | 33.068493 | 81 | 0.71251 |
4a01f2d853854df14aeb3e9d79b919cec8082bec | 4,964 | py | Python | cms/admin/settingsadmin.py | Mario-Kart-Felix/django-cms | 6d68439fe7fd59d000f99e27c1f2135a3f9c816a | [
"BSD-3-Clause"
] | 1,110 | 2020-10-08T15:12:08.000Z | 2022-03-31T23:08:37.000Z | cms/admin/settingsadmin.py | rpep/django-cms | 53dddb106f45963f9f8393d434b4313fa3bbdf54 | [
"BSD-3-Clause"
] | 410 | 2020-10-08T13:24:53.000Z | 2022-03-31T23:18:04.000Z | cms/admin/settingsadmin.py | rpep/django-cms | 53dddb106f45963f9f8393d434b4313fa3bbdf54 | [
"BSD-3-Clause"
] | 405 | 2020-10-08T21:22:30.000Z | 2022-03-30T20:58:14.000Z | import copy
import json
from functools import update_wrapper
from urllib.parse import urlparse
from django.urls import re_path
from django.contrib import admin
from django.contrib.admin import ModelAdmin
from django.contrib.auth.admin import csrf_protect_m
from django.db import transaction
from django.http import Htt... | 35.457143 | 96 | 0.639807 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.