hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13b4d3a68baccbd7f4bd02979209b96592b03de0 | 2,076 | py | Python | data_processing/dataset_processor.py | nazariinyzhnyk/fashion-img-segmentation | 99bc08fcda1fbc6453442b0d96a84bf40e7d0c4a | [
"MIT"
] | 1 | 2020-05-30T02:33:45.000Z | 2020-05-30T02:33:45.000Z | data_processing/dataset_processor.py | nazariinyzhnyk/fashion-img-segmentation | 99bc08fcda1fbc6453442b0d96a84bf40e7d0c4a | [
"MIT"
] | null | null | null | data_processing/dataset_processor.py | nazariinyzhnyk/fashion-img-segmentation | 99bc08fcda1fbc6453442b0d96a84bf40e7d0c4a | [
"MIT"
] | null | null | null | from mrcnn import utils
import os
import cv2
import numpy as np
from data_processing import resize_image, get_label_names
class DatasetProcessor(utils.Dataset):
def __init__(self, df):
super().__init__(self)
self.label_names = get_label_names(os.path.join('..', 'data', 'label_descriptions.json'))
... | 37.745455 | 108 | 0.585742 |
062874b1bb9104c34d08db9ad838ce9d1d3cbe3f | 6,939 | py | Python | ros/src/tl_detector/light_classification/tl_classifier.py | iammsg/Capstone-Project | 7191dea6168dc39b95c636d59b3a5d6d4ccd98c1 | [
"MIT"
] | null | null | null | ros/src/tl_detector/light_classification/tl_classifier.py | iammsg/Capstone-Project | 7191dea6168dc39b95c636d59b3a5d6d4ccd98c1 | [
"MIT"
] | 9 | 2020-01-28T22:44:12.000Z | 2022-03-11T23:47:37.000Z | ros/src/tl_detector/light_classification/tl_classifier.py | iammsg/Capstone-Project | 7191dea6168dc39b95c636d59b3a5d6d4ccd98c1 | [
"MIT"
] | null | null | null | import os
import cv2
import numpy as np
import rospy
import tensorflow as tf
from styx_msgs.msg import TrafficLight
import time
import json
from datetime import datetime
import os
dir = os.path.dirname(__file__)
class TLClassifier(object):
def now(self):
return str(datetime.now().strftime('%I:%M:%S.%f'))... | 37.711957 | 106 | 0.576452 |
1b490ba9b28b7ae6444832cc5cd9240f19101f87 | 851 | py | Python | coblog/urls.py | canokay/coblog-backend | 51854ed2d69f8484877bc9dcc95c19e3aa7d4107 | [
"MIT"
] | 1 | 2020-12-19T15:55:47.000Z | 2020-12-19T15:55:47.000Z | coblog/urls.py | canokay/coblog-backend | 51854ed2d69f8484877bc9dcc95c19e3aa7d4107 | [
"MIT"
] | null | null | null | coblog/urls.py | canokay/coblog-backend | 51854ed2d69f8484877bc9dcc95c19e3aa7d4107 | [
"MIT"
] | null | null | null | """coblog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 32.730769 | 77 | 0.703878 |
ba45ce35c091ae4088db67a455c7a72e1ca4862d | 1,027 | py | Python | src/rps/heredity_problems/mendels_first_law.py | Vikdemen/RosalindPS | 05cb3c2162e569bd92a99b9be127999cae1babf7 | [
"MIT"
] | 1 | 2020-03-01T11:57:56.000Z | 2020-03-01T11:57:56.000Z | src/rps/heredity_problems/mendels_first_law.py | Vikdemen/RosalindPS | 05cb3c2162e569bd92a99b9be127999cae1babf7 | [
"MIT"
] | null | null | null | src/rps/heredity_problems/mendels_first_law.py | Vikdemen/RosalindPS | 05cb3c2162e569bd92a99b9be127999cae1babf7 | [
"MIT"
] | 1 | 2020-03-01T18:39:44.000Z | 2020-03-01T18:39:44.000Z | """
Given: Three positive integers k, m, and n, representing a population containing k+m+n organisms: k individuals
are homozygous dominant for a factor, m are heterozygous, and n are homozygous recessive.
Return: The probability that two randomly selected mating organisms will produce an individual possessing a domina... | 46.681818 | 120 | 0.770204 |
a71497fc2e3c9991d0a18c534d45853aa45d8cd9 | 2,087 | py | Python | src/account/views.py | BusyJay/sokoban | a7fac324e9ee725c7954016d368d799ca2a7c47c | [
"MIT"
] | 1 | 2018-07-08T06:12:02.000Z | 2018-07-08T06:12:02.000Z | src/account/views.py | BusyJay/sokoban | a7fac324e9ee725c7954016d368d799ca2a7c47c | [
"MIT"
] | null | null | null | src/account/views.py | BusyJay/sokoban | a7fac324e9ee725c7954016d368d799ca2a7c47c | [
"MIT"
] | null | null | null | from django.conf import settings
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import login as auth_login, logout as auth_logout
from django.http import HttpResponse
from django.shortcuts import render, resolve_url
from django.utils.http import is_safe_url
from django.views.decorator... | 32.107692 | 75 | 0.667465 |
885ffac482ce6a6c47e37ca2153588eabd2be5cd | 18,819 | py | Python | log_complete/model_717.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_717.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_717.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 91.354369 | 710 | 0.806525 |
0c376b04830cf7cc698bd6837d06666e9ddce082 | 5,424 | py | Python | rsl/config.py | torchingloom/invenio-instance | b2cd4112e3960fa90fedf33bbedb2367f2ec47ac | [
"MIT"
] | null | null | null | rsl/config.py | torchingloom/invenio-instance | b2cd4112e3960fa90fedf33bbedb2367f2ec47ac | [
"MIT"
] | null | null | null | rsl/config.py | torchingloom/invenio-instance | b2cd4112e3960fa90fedf33bbedb2367f2ec47ac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 RSL.
#
# rsl is free software; you can redistribute it and/or modify it under the
# terms of the MIT License; see LICENSE file for more details.
"""Default configuration for rsl.
You overwrite and set instance-specific configuration by either:
- Configuration file: ``<v... | 31.534884 | 84 | 0.721792 |
fe48a7ec25fe0f5d9086e7d73c74d028c0a8705d | 2,576 | py | Python | WidgetsUnlimited/operations/simulator.py | AlanHorowitz/open-ended-capstone | 80590af5b09c2245f124cec20ed7594d62cff30e | [
"MIT"
] | null | null | null | WidgetsUnlimited/operations/simulator.py | AlanHorowitz/open-ended-capstone | 80590af5b09c2245f124cec20ed7594d62cff30e | [
"MIT"
] | null | null | null | WidgetsUnlimited/operations/simulator.py | AlanHorowitz/open-ended-capstone | 80590af5b09c2245f124cec20ed7594d62cff30e | [
"MIT"
] | null | null | null | from model.metadata import Table
from .generator import DataGenerator, GeneratorRequest
from .base import BaseSystem
from typing import List
class OperationsSimulator:
"""
A simulator of activity in Widgets Unlimited's source systems. A sequence of generation requests are processed and
new and updated re... | 42.933333 | 119 | 0.692935 |
24c47051d17926e9a104a129a551d7d6f05f4ba9 | 545 | py | Python | manage.py | guillaumepiot/cotidia-demo | 497177fa63942ee22288e93ed7d4867854110dd0 | [
"BSD-3-Clause"
] | null | null | null | manage.py | guillaumepiot/cotidia-demo | 497177fa63942ee22288e93ed7d4867854110dd0 | [
"BSD-3-Clause"
] | 7 | 2020-02-11T23:47:40.000Z | 2022-03-11T23:42:02.000Z | manage.py | guillaumepiot/cotidia-demo | 497177fa63942ee22288e93ed7d4867854110dd0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "consult.settings.local")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django... | 34.0625 | 77 | 0.688073 |
621aae82a06746cc648ac34db4a5733a56265f48 | 6,428 | py | Python | main.py | JDACS4C-IMPROVE/TGSA | cdd9903b889112b04325bec9f61935d05d9e9179 | [
"MIT"
] | 13 | 2021-06-17T15:01:49.000Z | 2022-03-11T05:19:28.000Z | main.py | JDACS4C-IMPROVE/TGSA | cdd9903b889112b04325bec9f61935d05d9e9179 | [
"MIT"
] | null | null | null | main.py | JDACS4C-IMPROVE/TGSA | cdd9903b889112b04325bec9f61935d05d9e9179 | [
"MIT"
] | 10 | 2021-10-06T08:56:58.000Z | 2022-03-22T04:55:44.000Z | import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
import torch
import torch.nn as nn
import numpy as np
import pandas as pd
from utils import load_data
from utils import EarlyStopping, set_random_seed
from utils import train, validate
from preprocess_gene import get_STRING_graph, get_predefine_cluster... | 50.614173 | 127 | 0.626167 |
2e0fa094285a5b3d5267707b6c8f3c80d4708a20 | 6,618 | py | Python | python-2-apps/fn_crowdstrike_query-1.0.0/fn_crowdstrike_query/util/customize.py | JayDi11a/Geralds-IBM-SOAR-Integrations | 0e0eb18adbaf3a266e1dc5a316df7cd5a93f88d0 | [
"MIT"
] | null | null | null | python-2-apps/fn_crowdstrike_query-1.0.0/fn_crowdstrike_query/util/customize.py | JayDi11a/Geralds-IBM-SOAR-Integrations | 0e0eb18adbaf3a266e1dc5a316df7cd5a93f88d0 | [
"MIT"
] | 1 | 2022-03-06T00:10:13.000Z | 2022-03-06T00:10:13.000Z | python-2-apps/fn_crowdstrike_query/fn_crowdstrike_query/util/customize.py.OLD.py | JayDi11a/Geralds-IBM-SOAR-Integrations | 0e0eb18adbaf3a266e1dc5a316df7cd5a93f88d0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Generate the Resilient customizations required for fn_crowdstrike_query"""
from __future__ import print_function
from resilient_circuits.util import *
def customization_data(client=None):
"""Produce any customization definitions (types, fields, message destinations, etc)
that s... | 62.433962 | 87 | 0.955878 |
8093ba3a64743151f52da01ac6dd3832d0c30355 | 10,174 | py | Python | docs/conf.py | WilliamMayor/jingerly | 225feb2e71b4256302209c815cccd54b694d52eb | [
"MIT"
] | null | null | null | docs/conf.py | WilliamMayor/jingerly | 225feb2e71b4256302209c815cccd54b694d52eb | [
"MIT"
] | null | null | null | docs/conf.py | WilliamMayor/jingerly | 225feb2e71b4256302209c815cccd54b694d52eb | [
"MIT"
] | 1 | 2020-02-23T15:07:47.000Z | 2020-02-23T15:07:47.000Z | # -*- coding: utf-8 -*-
#
# . documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 14 21:29:17 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All con... | 30.644578 | 80 | 0.716139 |
d4219fbd51a1b331ee29a550a7a35f570e296d0e | 471 | py | Python | cudaBLAS/pythonMatMultTest.py | CUDA-me-impressed/CuMat-Compiler | d5050f96a2712d4d135c1729484cd91db2bdd42e | [
"MIT"
] | 2 | 2020-10-18T10:29:34.000Z | 2021-01-05T15:46:34.000Z | cudaBLAS/pythonMatMultTest.py | CUDA-me-impressed/CuMat-Compiler | d5050f96a2712d4d135c1729484cd91db2bdd42e | [
"MIT"
] | 11 | 2020-10-08T18:41:20.000Z | 2021-03-19T14:49:19.000Z | cudaBLAS/pythonMatMultTest.py | CUDA-me-impressed/CuMat-Compiler | d5050f96a2712d4d135c1729484cd91db2bdd42e | [
"MIT"
] | null | null | null | import numpy as np
import timeit
def printAsCuMatMatrix(mat):
np.set_printoptions(threshold=9999999999)
file = "["
file = file + np.array2string(mat, separator=', ').replace('],', '\\').replace('[', '').replace(']','')
file = file + ']'
return file
dim = (200,200)
x = np.ones(dim, dtype=np.float... | 22.428571 | 107 | 0.615711 |
0e77c6b78f329c8168b2504893ea04df09895b99 | 782 | py | Python | user/views.py | Emmanuel-otieno/Awward_clone | ce0fb841984cae619599b51600403d7a1d873fc8 | [
"Unlicense"
] | null | null | null | user/views.py | Emmanuel-otieno/Awward_clone | ce0fb841984cae619599b51600403d7a1d873fc8 | [
"Unlicense"
] | null | null | null | user/views.py | Emmanuel-otieno/Awward_clone | ce0fb841984cae619599b51600403d7a1d873fc8 | [
"Unlicense"
] | null | null | null | from django.shortcuts import render,redirect
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from .forms import UserRegisterForm
# Create your views here.
def register(request):
if request.method == 'POST':
form= UserRegisterForm(request.POST)
if... | 30.076923 | 115 | 0.671355 |
bbff12c368c3635418ef4eed40dfee7495e72e9a | 2,636 | py | Python | venv/Lib/site-packages/pkginfo/tests/test_index.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 54 | 2019-10-30T19:32:23.000Z | 2022-03-16T13:40:40.000Z | venv/Lib/site-packages/pkginfo/tests/test_index.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 301 | 2020-10-03T10:46:31.000Z | 2022-03-27T23:46:23.000Z | venv/Lib/site-packages/pkginfo/tests/test_index.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 19 | 2019-12-14T05:21:22.000Z | 2021-06-29T14:33:59.000Z | import unittest
class IndexTests(unittest.TestCase):
def _getTargetClass(self):
from pkginfo.index import Index
return Index
def _makeOne(self):
return self._getTargetClass()()
def test_empty(self):
index = self._makeOne()
self.assertEqual(len(index), 0)
s... | 34.233766 | 76 | 0.614568 |
ea90319590a2ee38fc301b13217a6a409333eff4 | 1,819 | py | Python | prophy/tests/test_float.py | florczakraf/prophy | a42a6151a77b31afa05300fc2e1f52cc15a298cf | [
"MIT"
] | 14 | 2015-02-19T22:00:37.000Z | 2020-11-30T03:03:55.000Z | prophy/tests/test_float.py | florczakraf/prophy | a42a6151a77b31afa05300fc2e1f52cc15a298cf | [
"MIT"
] | 31 | 2015-06-22T11:11:10.000Z | 2021-05-12T06:35:47.000Z | prophy/tests/test_float.py | florczakraf/prophy | a42a6151a77b31afa05300fc2e1f52cc15a298cf | [
"MIT"
] | 16 | 2015-06-12T06:48:06.000Z | 2019-11-26T22:48:13.000Z | import prophy
import pytest
def Float():
class Float(prophy.with_metaclass(prophy.struct_generator, prophy.struct)):
_descriptor = [("value", prophy.r32)]
return Float
def Double():
class Double(prophy.with_metaclass(prophy.struct_generator, prophy.struct)):
_descriptor = [("value", prop... | 25.263889 | 87 | 0.619021 |
3699bce78aeda766266e83dd1ef7aebc36ff7596 | 282 | py | Python | basic-service/tanya/solve.py | tanyav2/hackasat-qualifier-2021 | 595338e375f3c7f53b0f8b1cc886eb62462c750e | [
"MIT"
] | null | null | null | basic-service/tanya/solve.py | tanyav2/hackasat-qualifier-2021 | 595338e375f3c7f53b0f8b1cc886eb62462c750e | [
"MIT"
] | null | null | null | basic-service/tanya/solve.py | tanyav2/hackasat-qualifier-2021 | 595338e375f3c7f53b0f8b1cc886eb62462c750e | [
"MIT"
] | null | null | null | import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost", 12345))
data = s.recv(22)
# split string into two variables
ns = data.decode("utf-8").split(" ")
n1 = int(ns[0])
n2 = int(ns[2])
sum = n1 + n2
str_sum = str(sum)
s.send(str_sum.encode())
| 18.8 | 53 | 0.673759 |
dc293028476940544df3d74d1cb040e4eb5ed61b | 37,005 | bzl | Python | internal/rollup/rollup_bundle.bzl | tarekbecker/rules_nodejs | 8da02819ecf966f2a7acc4ef2c2f2f0f2d8ab4a7 | [
"Apache-2.0"
] | null | null | null | internal/rollup/rollup_bundle.bzl | tarekbecker/rules_nodejs | 8da02819ecf966f2a7acc4ef2c2f2f0f2d8ab4a7 | [
"Apache-2.0"
] | null | null | null | internal/rollup/rollup_bundle.bzl | tarekbecker/rules_nodejs | 8da02819ecf966f2a7acc4ef2c2f2f0f2d8ab4a7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Bazel 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 la... | 43.382181 | 201 | 0.674368 |
08d93d9115e0536bd183b34532c584fad2d0a901 | 2,478 | py | Python | src/robot/model/message.py | bradyarthur/RobotFramework | f45747dfec1095359379ba0088cecd955a83e576 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/model/message.py | bradyarthur/RobotFramework | f45747dfec1095359379ba0088cecd955a83e576 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-01-21T03:06:37.000Z | 2021-01-21T03:06:37.000Z | src/robot/model/message.py | bradyarthur/RobotFramework | f45747dfec1095359379ba0088cecd955a83e576 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... | 34.901408 | 90 | 0.66021 |
6e56812ff4d0924178dc5c8e2476bf37e6411018 | 20,136 | py | Python | tests.py | wannaphong/TextRecognitionDataGenerator | bb23f065c1cafef8a58851a2d196417cdca19b49 | [
"MIT"
] | 8 | 2019-06-01T14:59:12.000Z | 2021-06-14T04:27:45.000Z | tests.py | wannaphong/TextRecognitionDataGenerator | bb23f065c1cafef8a58851a2d196417cdca19b49 | [
"MIT"
] | 10 | 2020-01-28T22:45:39.000Z | 2022-02-10T00:22:28.000Z | tests.py | wannaphong/TextRecognitionDataGenerator | bb23f065c1cafef8a58851a2d196417cdca19b49 | [
"MIT"
] | 4 | 2019-07-25T09:40:52.000Z | 2020-03-18T14:17:23.000Z | import os
import sys
import unittest
import subprocess
import hashlib
import string
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), './TextRecognitionDataGenerator')))
try:
os.mkdir('tests/out')
except:
pass
from TextRecognitionDataGenerator.data_generator import FakeTextDataGenera... | 28.083682 | 124 | 0.480979 |
0fb85f11d1b565eb1d9774c265013ce60ad26d59 | 19,230 | py | Python | tests/scenario_tests_async/test_events_shared_channels.py | korymath/bolt-python | 67e0286d756ba92510315d044303f43b03380b52 | [
"MIT"
] | 1 | 2021-05-02T16:06:44.000Z | 2021-05-02T16:06:44.000Z | tests/scenario_tests_async/test_events_shared_channels.py | korymath/bolt-python | 67e0286d756ba92510315d044303f43b03380b52 | [
"MIT"
] | 1 | 2021-02-23T21:05:57.000Z | 2021-02-23T21:05:57.000Z | tests/scenario_tests_async/test_events_shared_channels.py | korymath/bolt-python | 67e0286d756ba92510315d044303f43b03380b52 | [
"MIT"
] | null | null | null | import asyncio
import json
from random import random
from time import time
import pytest
from slack_sdk.signature import SignatureVerifier
from slack_sdk.web.async_client import AsyncWebClient
from slack_bolt.app.async_app import AsyncApp
from slack_bolt.authorization import AuthorizeResult
from slack_bolt.context.sa... | 34.035398 | 87 | 0.561258 |
09032824deadde17dc95c755a9a0d23a22540272 | 623 | py | Python | lib/sedna/__init__.py | wangyuan249/sedna | 304059ef46e87a637eff22a92f1b0894216fa3ea | [
"Apache-2.0"
] | 1 | 2021-01-29T11:12:54.000Z | 2021-01-29T11:12:54.000Z | lib/sedna/__init__.py | kevinshan/sedna | 9411a2cd0ef5e86ed76a910d60685e37d4404b65 | [
"Apache-2.0"
] | null | null | null | lib/sedna/__init__.py | kevinshan/sedna | 9411a2cd0ef5e86ed76a910d60685e37d4404b65 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The KubeEdge 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 applicable law or agreed to in... | 38.9375 | 74 | 0.76886 |
8f97a64707f7e163039bd21801880aef0f192d11 | 6,387 | py | Python | telecarla_scenario_runner/script/plot_results.py | hofbi/telecarla | 020704a3b7087bc426f5ff97655c7e676c8b01bf | [
"MIT"
] | 26 | 2020-06-09T18:28:07.000Z | 2022-03-19T01:27:40.000Z | telecarla_scenario_runner/script/plot_results.py | hofbi/telecarla | 020704a3b7087bc426f5ff97655c7e676c8b01bf | [
"MIT"
] | 15 | 2020-06-21T21:04:44.000Z | 2022-02-20T17:24:58.000Z | telecarla_scenario_runner/script/plot_results.py | hofbi/telecarla | 020704a3b7087bc426f5ff97655c7e676c8b01bf | [
"MIT"
] | 7 | 2020-06-21T11:55:53.000Z | 2021-12-18T09:16:06.000Z | """
Plot results of one or multiple scenario runner evaluations
"""
import argparse
import os
import re
import statistics
import sys
import xml.etree.cElementTree as ET
import matplotlib.pyplot as plt
import numpy as np
class ScenarioResult:
"""
Collection of multiple results for the same scenario
"""
... | 26.502075 | 88 | 0.627994 |
23e8320d0330d1ec8f7c296ccce6c6ea052ae6e2 | 12,809 | py | Python | ief_core/tests/old_tests/test_rnn.py | zeshanmh/ief | 1b7dbd340ecb8ccf40d22de989e3bc3d92135a45 | [
"MIT"
] | 5 | 2021-04-11T04:49:24.000Z | 2022-03-28T18:43:45.000Z | ief_core/tests/old_tests/test_rnn.py | clinicalml/ief | 97bcaad85ec820fbe062a86c6c500a308904f029 | [
"MIT"
] | 1 | 2021-12-13T06:33:16.000Z | 2021-12-16T02:04:14.000Z | ief_core/tests/old_tests/test_rnn.py | clinicalml/ief | 97bcaad85ec820fbe062a86c6c500a308904f029 | [
"MIT"
] | 1 | 2022-02-01T03:10:16.000Z | 2022-02-01T03:10:16.000Z | import torch
import torch.nn as nn
import numpy as np
import pytorch_lightning as pl
import sys
import optuna
import os
from lifelines.utils import concordance_index
from sklearn.metrics import r2_score
from torch.utils.data import DataLoader, TensorDataset
from torchcontrib.optim import SWA
from pytorch_lightning im... | 51.649194 | 230 | 0.666406 |
723203e05697d79668f0deb0825cc7523aa5ba48 | 7,223 | py | Python | tests/test_TDict.py | tadashi-aikawa/dict-mixin | 6418694aa2f7a8dc2c1990818a917e9b22ec1d16 | [
"MIT"
] | 3 | 2018-03-09T05:01:34.000Z | 2020-10-29T01:29:28.000Z | tests/test_TDict.py | tadashi-aikawa/dict-mixin | 6418694aa2f7a8dc2c1990818a917e9b22ec1d16 | [
"MIT"
] | 13 | 2017-11-07T08:28:51.000Z | 2020-07-11T09:20:47.000Z | tests/test_TDict.py | tadashi-aikawa/dict-mixin | 6418694aa2f7a8dc2c1990818a917e9b22ec1d16 | [
"MIT"
] | 1 | 2017-03-11T19:19:33.000Z | 2017-03-11T19:19:33.000Z | # coding: utf-8
from owlmixin import OwlMixin, TOption
from owlmixin.owlcollections import TDict, TList
# For python 3.5.0-3.5.1
try:
from typing import Text
except ImportError:
pass
class Address(OwlMixin):
name: str
class Spot(OwlMixin):
names: TList[str]
address: TOption[Address]
class Te... | 30.348739 | 120 | 0.47418 |
180b33ab8cca22ba43ba48d81418db32aceeff8d | 5,899 | py | Python | bot.py | theerfan/PublicQABot | d18b351e8ad502ddc60f9f2a870be9fe8601b71b | [
"MIT"
] | 4 | 2019-07-04T20:36:59.000Z | 2022-03-03T09:00:55.000Z | bot.py | theerfan/PublicQABot | d18b351e8ad502ddc60f9f2a870be9fe8601b71b | [
"MIT"
] | null | null | null | bot.py | theerfan/PublicQABot | d18b351e8ad502ddc60f9f2a870be9fe8601b71b | [
"MIT"
] | null | null | null | import telegram
from telegram.ext import Updater, Dispatcher, MessageHandler, MessageQueue, CommandHandler, Filters
TOKEN = "REDACTED"
bot = telegram.Bot(TOKEN)
updater = Updater(token=TOKEN)
dispatcher = updater.dispatcher
jq = updater.job_queue
list_of_active_users = dict()
FAIL_TEXT = "متاسفانه مشکلی پیش اومد، لطف... | 37.100629 | 119 | 0.68537 |
a498960ba6c4d99d2c29abba40d960990e60d4a6 | 842 | py | Python | molecool/io/xyz.py | rtb1c13/molecool | b296f7c3afea4bad32e4b20000a0ec1e82c7c3ce | [
"BSD-3-Clause"
] | null | null | null | molecool/io/xyz.py | rtb1c13/molecool | b296f7c3afea4bad32e4b20000a0ec1e82c7c3ce | [
"BSD-3-Clause"
] | 1 | 2020-05-08T15:52:06.000Z | 2020-05-08T15:52:55.000Z | molecool/io/xyz.py | rtb1c13/molecool | b296f7c3afea4bad32e4b20000a0ec1e82c7c3ce | [
"BSD-3-Clause"
] | null | null | null | """
Functions to manipulate xyz files
"""
import numpy as np
def open_xyz(file_location):
# Open an xyz file and return symbols and coordinates.
xyz_file = np.genfromtxt(fname=file_location, skip_header=2, dtype='unicode')
symbols = xyz_file[:,0]
coords = (xyz_file[:,1:])
coords = coords.asty... | 30.071429 | 100 | 0.602138 |
0640362b1b5f8b321827749bf43fc6efba3566f0 | 9,237 | py | Python | gewittergefahr/scripts/run_echo_top_tracking.py | dopplerchase/GewitterGefahr | 4415b08dd64f37eba5b1b9e8cc5aa9af24f96593 | [
"MIT"
] | 26 | 2018-10-04T01:07:35.000Z | 2022-01-29T08:49:32.000Z | gewittergefahr/scripts/run_echo_top_tracking.py | liuximarcus/GewitterGefahr | d819874d616f98a25187bfd3091073a2e6d5279e | [
"MIT"
] | 4 | 2017-12-25T02:01:08.000Z | 2018-12-19T01:54:21.000Z | gewittergefahr/scripts/run_echo_top_tracking.py | liuximarcus/GewitterGefahr | d819874d616f98a25187bfd3091073a2e6d5279e | [
"MIT"
] | 11 | 2017-12-10T23:05:29.000Z | 2022-01-29T08:49:33.000Z | """Tracks storms based on echo top."""
import argparse
from gewittergefahr.gg_io import myrorss_io
from gewittergefahr.gg_utils import radar_utils
from gewittergefahr.gg_utils import time_conversion
from gewittergefahr.gg_utils import echo_top_tracking
SEPARATOR_STRING = '\n\n' + '*' * 50 + '\n\n'
NATIVE_ECHO_TOP_FI... | 40.69163 | 80 | 0.761936 |
78db2eb650151c9726e8651058d7cffe4555fdf0 | 4,792 | py | Python | data/external/repositories_2to3/42139/KDDCup13Track2-master/cluster_hc.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/42139/KDDCup13Track2-master/cluster_hc.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/42139/KDDCup13Track2-master/cluster_hc.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | #!/usr/bin/env python
# Given weighted graph, perform hierarchical clustering
from common import *
import argparse
import csv
import numpy as np
import scipy as sp
import pickle as pickle
from pprint import pprint
import networkx as nx
from itertools import combinations, product
import heapq as hq
from clus... | 37.4375 | 141 | 0.679466 |
7790d490a481d17a059a7dfee406a3429d42670d | 2,273 | py | Python | rqalpha/mod/rqalpha_mod_sys_transaction_cost/__init__.py | meteor27/alpha_mod | 4f7f0edf8338451a69f177058ec80766d846769e | [
"Apache-2.0"
] | null | null | null | rqalpha/mod/rqalpha_mod_sys_transaction_cost/__init__.py | meteor27/alpha_mod | 4f7f0edf8338451a69f177058ec80766d846769e | [
"Apache-2.0"
] | 2 | 2021-01-25T09:49:55.000Z | 2021-01-25T09:50:37.000Z | rqalpha/mod/rqalpha_mod_sys_transaction_cost/__init__.py | meteor27/alpha_mod | 4f7f0edf8338451a69f177058ec80766d846769e | [
"Apache-2.0"
] | 2 | 2021-01-10T10:35:13.000Z | 2021-01-10T10:43:13.000Z | # -*- coding: utf-8 -*-
# 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”)
#
# 除非遵守当前许可,否则不得使用本软件。
#
# * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件):
# 遵守 Apache License 2.0(下称“Apache 2.0 许可”),您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。
# 除非法律有要求或以书面形式达成协议,否则本软件分发时需保持当前许可“原样”... | 28.4125 | 144 | 0.673999 |
2fe877dd963542ab459cce83de295fce0d921eab | 453 | py | Python | src/ucis/scdb/scdb_scope.py | furiosa-ai/pyucis | 233277abf5a86e1158ae2cc09d91152ca9f1e517 | [
"Apache-2.0"
] | 16 | 2020-03-25T21:31:49.000Z | 2022-01-18T22:34:05.000Z | src/ucis/scdb/scdb_scope.py | furiosa-ai/pyucis | 233277abf5a86e1158ae2cc09d91152ca9f1e517 | [
"Apache-2.0"
] | 4 | 2020-01-05T00:26:00.000Z | 2022-01-27T07:44:06.000Z | src/ucis/scdb/scdb_scope.py | furiosa-ai/pyucis | 233277abf5a86e1158ae2cc09d91152ca9f1e517 | [
"Apache-2.0"
] | 4 | 2019-12-23T06:23:11.000Z | 2022-01-09T07:41:32.000Z | '''
Created on Mar 25, 2020
@author: ballance
'''
from ucis.scope import Scope
from ucis.source_info import SourceInfo
class SCDBScope(Scope):
def __init__(self):
Scope.__init__(self)
pass
def createScope(self,
name:str,
srcinfo:SourceInfo,
weight:int,
... | 18.875 | 75 | 0.593819 |
2e61fa89ecb45046b2800e940389c95f899ca6cc | 21,796 | py | Python | cisco_aci/tests/test_capacity.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | null | null | null | cisco_aci/tests/test_capacity.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | null | null | null | cisco_aci/tests/test_capacity.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2010-2018
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
import pytest
import logging
import simplejson as json
from requests import Session
from datadog_checks.cisco_aci.api import SessionWrapper, Api
from datadog_checks.cisco_aci.capacity import Capacity
fr... | 49.762557 | 120 | 0.562901 |
99051d771d01044fe34af1853799adb6c3943988 | 3,051 | py | Python | matrixprofile/algorithms/mpx.py | KSaiRahul21/matrixprofile | d8250e30d90ed0453bb7c35bb34ab0c04ae7b334 | [
"Apache-2.0"
] | null | null | null | matrixprofile/algorithms/mpx.py | KSaiRahul21/matrixprofile | d8250e30d90ed0453bb7c35bb34ab0c04ae7b334 | [
"Apache-2.0"
] | null | null | null | matrixprofile/algorithms/mpx.py | KSaiRahul21/matrixprofile | d8250e30d90ed0453bb7c35bb34ab0c04ae7b334 | [
"Apache-2.0"
] | 1 | 2020-04-10T19:15:17.000Z | 2020-04-10T19:15:17.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
range = getattr(__builtins__, 'xrange', range)
# end of py2 compatability boilerplate
import math
import numpy as np
from... | 29.911765 | 79 | 0.579154 |
a626250de91365f58cfe051b4944c144f5e92339 | 871 | py | Python | graphics/density.py | tman540/probability-simulator | c3bc679d1f77fd751bc981734583bdc017290aef | [
"MIT"
] | null | null | null | graphics/density.py | tman540/probability-simulator | c3bc679d1f77fd751bc981734583bdc017290aef | [
"MIT"
] | null | null | null | graphics/density.py | tman540/probability-simulator | c3bc679d1f77fd751bc981734583bdc017290aef | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib.style as style
# Set theme of graph
style.use('ggplot')
def heatmap(data):
# Define separate lists for x and y
x, y = [], []
# Separate the x and the y
for point in data:
x.append(point[0])
y.append(point[1])
# Define the color m... | 27.21875 | 64 | 0.647532 |
9c699c988522045cdf0f46825a21b7560d6deb81 | 1,774 | py | Python | src/m6e_grid_layout.py | colledkm/24-Tkinter | 4a900678902bf5d51d7df5e49cfb83262de742e6 | [
"MIT"
] | null | null | null | src/m6e_grid_layout.py | colledkm/24-Tkinter | 4a900678902bf5d51d7df5e49cfb83262de742e6 | [
"MIT"
] | null | null | null | src/m6e_grid_layout.py | colledkm/24-Tkinter | 4a900678902bf5d51d7df5e49cfb83262de742e6 | [
"MIT"
] | 97 | 2019-01-31T13:03:14.000Z | 2019-02-04T18:42:49.000Z | """
Example showing for tkinter and ttk:
-- How to layout objects using a grid of rows and columns.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,
and PUT_YOUR_NAME_HERE.
""" # TODO: 1. PUT YOUR NAME IN THE ABOVE LINE.
... | 34.784314 | 79 | 0.468997 |
3357437eb4b1662ee121c3fe3c9ab5a2bb9e3cab | 6,552 | py | Python | tests/test_serialization.py | foobarbazmeow/marshmallow-recipe | 5bce8abd5db1abec4d60cfa2cd1428c6c5738566 | [
"MIT"
] | null | null | null | tests/test_serialization.py | foobarbazmeow/marshmallow-recipe | 5bce8abd5db1abec4d60cfa2cd1428c6c5738566 | [
"MIT"
] | null | null | null | tests/test_serialization.py | foobarbazmeow/marshmallow-recipe | 5bce8abd5db1abec4d60cfa2cd1428c6c5738566 | [
"MIT"
] | null | null | null | import dataclasses
import datetime
import decimal
import uuid
from typing import Any, cast
import marshmallow as m
import pytest
import marshmallow_recipe as mr
def test_simple_types() -> None:
@dataclasses.dataclass(frozen=True, slots=True, kw_only=True)
class SimpleTypesContainers:
str_field: str
... | 33.773196 | 120 | 0.688797 |
8d4b883cfecb3e2c64a2b6e0276c301f23f699fe | 2,525 | py | Python | src/oci/os_management/models/change_scheduled_job_compartment_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/os_management/models/change_scheduled_job_compartment_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/os_management/models/change_scheduled_job_compartment_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 32.792208 | 245 | 0.689505 |
9c4b5297fa20d93766f9d0b3cbb1674a32b9d5fa | 8,307 | py | Python | typeclasses/readable/readable_commands.py | sgsabbage/arxcode | ff1587721f9896062ffdcaf008dcd842baaec5d2 | [
"MIT"
] | 42 | 2018-08-12T00:55:24.000Z | 2021-12-24T15:16:08.000Z | typeclasses/readable/readable_commands.py | sgsabbage/arxcode | ff1587721f9896062ffdcaf008dcd842baaec5d2 | [
"MIT"
] | 312 | 2018-10-22T23:03:27.000Z | 2022-02-06T13:02:58.000Z | typeclasses/readable/readable_commands.py | sgsabbage/arxcode | ff1587721f9896062ffdcaf008dcd842baaec5d2 | [
"MIT"
] | 42 | 2018-08-12T00:41:48.000Z | 2022-01-27T14:03:16.000Z | from commands.base import ArxCommand
from evennia.utils.ansi import parse_ansi
from server.utils.arx_utils import sub_old_ansi
from typeclasses.readable.exceptions import ChapterNotFoundError, AddChapterError
from world.templates.exceptions import AlreadySignedError
from server.utils import arx_more
from world.template... | 35.050633 | 85 | 0.594077 |
0ad752ec8b72a023479c45e6834e623231e1a3b4 | 5,498 | py | Python | gssapi/_utils.py | atodorov/python-gssapi | 99ee548cd871451047612d2fd1cd0be88bb56bfd | [
"ISC"
] | null | null | null | gssapi/_utils.py | atodorov/python-gssapi | 99ee548cd871451047612d2fd1cd0be88bb56bfd | [
"ISC"
] | null | null | null | gssapi/_utils.py | atodorov/python-gssapi | 99ee548cd871451047612d2fd1cd0be88bb56bfd | [
"ISC"
] | null | null | null | import sys
import types
import six
import decorator as deco
from typing import Optional
from gssapi.raw.misc import GSSError
def import_gssapi_extension(name):
"""Import a GSSAPI extension module
This method imports a GSSAPI extension module based
on the name of the extension (not including the
'e... | 26.819512 | 79 | 0.618225 |
896e57c47139d74b05a23fda7594338a940cf40a | 1,206 | py | Python | custom_usermodel/tests/test_models.py | uktrade/return-to-office | d4c53c734611413c9f8a7624e52dc35910c5ff57 | [
"MIT"
] | 1 | 2020-10-25T18:16:47.000Z | 2020-10-25T18:16:47.000Z | custom_usermodel/tests/test_models.py | uktrade/return-to-office | d4c53c734611413c9f8a7624e52dc35910c5ff57 | [
"MIT"
] | 1 | 2020-10-27T07:11:26.000Z | 2020-10-27T07:11:26.000Z | custom_usermodel/tests/test_models.py | uktrade/return-to-office | d4c53c734611413c9f8a7624e52dc35910c5ff57 | [
"MIT"
] | null | null | null | from custom_usermodel.models import User
def test_get_contact_email():
user = User(email="not-a-contact-email@somewhere.com", contact_email="hello@world.com")
assert user.get_contact_email() == "hello@world.com"
def test_get_contact_email_falls_back_email():
user = User(email="hello@world.com")
as... | 32.594595 | 91 | 0.743781 |
35b6016e18ca191a147eb20e1123bf01d321acef | 10,529 | py | Python | ch09/improved_spark_mllib_model.py | wikibook/agile-data-science | 7769fc2d6c810e9f1a64e45d3684e9260d99d983 | [
"MIT"
] | 1 | 2020-02-13T05:45:13.000Z | 2020-02-13T05:45:13.000Z | ch09/improved_spark_mllib_model.py | wikibook/agile-data-science | 7769fc2d6c810e9f1a64e45d3684e9260d99d983 | [
"MIT"
] | null | null | null | ch09/improved_spark_mllib_model.py | wikibook/agile-data-science | 7769fc2d6c810e9f1a64e45d3684e9260d99d983 | [
"MIT"
] | null | null | null | # !/usr/bin/env python
import sys, os, re
import json
import datetime, iso8601
from tabulate import tabulate
# airflow에서 날짜와 기본 경로를 main()으로 전달
def main(base_path):
APP_NAME = "train_spark_mllib_model.py"
# SparkSession이 없으면 환경 생성
try:
sc and spark
except NameError as e:
import findspark
findsp... | 30.607558 | 113 | 0.690759 |
37fb5576a209175df8ff268d4c7d651d74f53d74 | 9,977 | py | Python | FSM Equivalence Checker/trace2dot.py | sizaif/DIKEUE | ed13e16e560003ae9561db6a39662f321b01ef60 | [
"Apache-2.0"
] | 3 | 2021-11-16T05:09:23.000Z | 2022-03-19T21:51:27.000Z | FSM Equivalence Checker/trace2dot.py | sizaif/DIKEUE | ed13e16e560003ae9561db6a39662f321b01ef60 | [
"Apache-2.0"
] | null | null | null | FSM Equivalence Checker/trace2dot.py | sizaif/DIKEUE | ed13e16e560003ae9561db6a39662f321b01ef60 | [
"Apache-2.0"
] | 2 | 2021-11-18T00:33:28.000Z | 2021-12-15T05:06:21.000Z | #!/usr/bin/env python
"""
simple script to visualize the trace output of smv / NuSMV
via Graphviz's dot-format. first, the trace is parsed and
then coded as dot-graph with states as nodes and input
(transitions) as arcs between them. even if the counterexample's
loop start- and end-state are the same, they are represe... | 31.773885 | 103 | 0.573519 |
d50f7f0e1065f7b8f4ec000bc8954587328fe0ad | 4,141 | py | Python | pandasio/utils/tests/test_binary.py | BrianKopp/pandas-io | cbab1146289a6fdbbd2ff7e3aaa55ff64e228fb7 | [
"MIT"
] | 1 | 2019-05-11T22:09:35.000Z | 2019-05-11T22:09:35.000Z | pandasio/utils/tests/test_binary.py | BrianKopp/pandas-io | cbab1146289a6fdbbd2ff7e3aaa55ff64e228fb7 | [
"MIT"
] | null | null | null | pandasio/utils/tests/test_binary.py | BrianKopp/pandas-io | cbab1146289a6fdbbd2ff7e3aaa55ff64e228fb7 | [
"MIT"
] | null | null | null | from pandasio.utils.binary import determine_required_bytes_unsigned_integer, read_unsigned_int, \
determine_required_bytes_signed_integer
from pandasio.utils.exceptions import (
IntegerLargerThan64BitsException,
IntegerNotUnsignedException,
NotIntegerException
)
import unittest
class TestBinaryUtils(u... | 51.123457 | 97 | 0.765274 |
f413e5221b44192deeca79bf84f7a89b86acbb30 | 5,336 | py | Python | syntropy_sdk/models/change_path_object_data_costs.py | SyntropyNet/syntropy-python-sdk | 27b7756b136f83886fd2a6e342fa4d4073779ff7 | [
"MIT"
] | 1 | 2020-12-17T17:30:12.000Z | 2020-12-17T17:30:12.000Z | syntropy_sdk/models/change_path_object_data_costs.py | SyntropyNet/syntropy-python-sdk | 27b7756b136f83886fd2a6e342fa4d4073779ff7 | [
"MIT"
] | null | null | null | syntropy_sdk/models/change_path_object_data_costs.py | SyntropyNet/syntropy-python-sdk | 27b7756b136f83886fd2a6e342fa4d4073779ff7 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
syntropy-controller
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
imp... | 27.364103 | 119 | 0.571402 |
01347536c2c2020872bc115a011eab009dc8c69d | 751 | py | Python | test/unit/rules/parameters/test_configuration.py | tomislacker/cfn-python-lint | f209ddfef9bcc1a005adfebcfcc16220b18deddb | [
"MIT-0"
] | 1,134 | 2019-03-02T14:58:34.000Z | 2021-05-15T00:57:16.000Z | test/unit/rules/parameters/test_configuration.py | tomislacker/cfn-python-lint | f209ddfef9bcc1a005adfebcfcc16220b18deddb | [
"MIT-0"
] | 1,122 | 2019-03-03T04:27:15.000Z | 2021-05-14T20:51:16.000Z | test/unit/rules/parameters/test_configuration.py | tomislacker/cfn-python-lint | f209ddfef9bcc1a005adfebcfcc16220b18deddb | [
"MIT-0"
] | 297 | 2019-03-11T09:56:57.000Z | 2021-05-14T16:41:19.000Z | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from test.unit.rules import BaseRuleTestCase
from cfnlint.rules.parameters.Configuration import Configuration # pylint: disable=E0401
class TestParameterConfiguration(BaseRuleTestCase):
"""Test template para... | 31.291667 | 97 | 0.719041 |
3991d30c11043707a184da175a9ffae8a84746f1 | 829 | py | Python | kedro-intro/src/kedro_intro/hooks.py | avallarino-ar/kedro_lab | e91bf61c21978f18222e4c7affef39e4707890b8 | [
"MIT"
] | 11 | 2022-02-06T18:01:29.000Z | 2022-02-23T15:51:48.000Z | kedro-intro/src/kedro_intro/hooks.py | avallarino-ar/kedro_lab | e91bf61c21978f18222e4c7affef39e4707890b8 | [
"MIT"
] | 6 | 2022-03-12T02:21:28.000Z | 2022-03-20T11:44:29.000Z | kedro-intro/src/kedro_intro/hooks.py | avallarino-ar/kedro_lab | e91bf61c21978f18222e4c7affef39e4707890b8 | [
"MIT"
] | 6 | 2021-09-24T16:12:02.000Z | 2021-12-12T18:31:14.000Z | """Project hooks."""
from typing import Any, Dict, Iterable, Optional
from kedro.config import ConfigLoader
from kedro.framework.hooks import hook_impl
from kedro.io import DataCatalog
from kedro.versioning import Journal
class ProjectHooks:
@hook_impl
def register_config_loader(
self, conf_paths: It... | 28.586207 | 80 | 0.674306 |
cf7b26098ec943c1cec36af08a970bcbd978abcc | 5,758 | py | Python | sdk/python/pulumi_azure/lb/backend_address_pool.py | kenny-wealth/pulumi-azure | e57e3a81f95bf622e7429c53f0bff93e33372aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/lb/backend_address_pool.py | kenny-wealth/pulumi-azure | e57e3a81f95bf622e7429c53f0bff93e33372aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/lb/backend_address_pool.py | kenny-wealth/pulumi-azure | e57e3a81f95bf622e7429c53f0bff93e33372aa1 | [
"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 Backen... | 50.508772 | 175 | 0.697464 |
6865b9982e6a2ff3ea84fd9d651a105791078365 | 3,221 | py | Python | app/recipe/tests/test_tags_api.py | mzwamshandu/recipe-app-api | cc7da9c7e72da318ca3f36bd4a3fcf173ef1a929 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | mzwamshandu/recipe-app-api | cc7da9c7e72da318ca3f36bd4a3fcf173ef1a929 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | mzwamshandu/recipe-app-api | cc7da9c7e72da318ca3f36bd4a3fcf173ef1a929 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag, Recipe
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class Publ... | 32.535354 | 74 | 0.652903 |
8921100f6af7a1a68238269131cbcbe0121a025b | 29,247 | py | Python | ChemicalReactorNetwork/combustion_chamber_design.py | giovaniceotto/Noelle | 436a91a6e2a2baf5ede419e9633cdf3479213786 | [
"MIT"
] | 6 | 2020-08-31T12:29:03.000Z | 2022-01-10T01:35:24.000Z | ChemicalReactorNetwork/combustion_chamber_design.py | giovaniceotto/LMS | 436a91a6e2a2baf5ede419e9633cdf3479213786 | [
"MIT"
] | 2 | 2020-07-27T18:12:57.000Z | 2020-08-06T02:20:14.000Z | ChemicalReactorNetwork/combustion_chamber_design.py | giovaniceotto/LMS | 436a91a6e2a2baf5ede419e9633cdf3479213786 | [
"MIT"
] | 2 | 2021-06-11T01:44:46.000Z | 2021-06-14T05:01:41.000Z | import numpy as np
# np.set_printoptions(precision=2)
import scipy.integrate
import scipy.signal
from rocketpy import Function
import CoolProp.CoolProp as CoolProp
from CoolProp.CoolProp import PropsSI
import cantera as ct
print('Runnning Cantera version: ' + ct.__version__)
# Matplotlib
import matplotlib as mpl
impo... | 36.107407 | 160 | 0.609943 |
f4d5719da80cd81b9498f918d2cb3fcef37ae073 | 1,696 | py | Python | tchannel/retry.py | srcclr/tchannel-python | 5e82535f96ba247ade5a040010edfa026e0f7dce | [
"MIT"
] | null | null | null | tchannel/retry.py | srcclr/tchannel-python | 5e82535f96ba247ade5a040010edfa026e0f7dce | [
"MIT"
] | 4 | 2021-03-17T08:31:59.000Z | 2021-06-25T15:49:37.000Z | tchannel/retry.py | susanstdemos/test-python-pip | 5e82535f96ba247ade5a040010edfa026e0f7dce | [
"MIT"
] | 4 | 2016-06-05T14:20:55.000Z | 2020-08-24T16:28:41.000Z | # Copyright (c) 2015 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.44186 | 79 | 0.772406 |
7101e726fa86a28ff667ccace12722a4d65a8fa7 | 5,104 | py | Python | tidepool_data_science_models/models/simple_metabolism_OLD.py | tidepool-org/data-science-models | cd06e9aad95a0bc6cc2a81871e567c88159b86d3 | [
"BSD-2-Clause"
] | 1 | 2020-10-17T19:48:38.000Z | 2020-10-17T19:48:38.000Z | tidepool_data_science_models/models/simple_metabolism_OLD.py | tidepool-org/data-science-models | cd06e9aad95a0bc6cc2a81871e567c88159b86d3 | [
"BSD-2-Clause"
] | 4 | 2020-05-27T16:38:56.000Z | 2020-11-21T21:09:23.000Z | tidepool_data_science_models/models/simple_metabolism_OLD.py | tidepool-org/data-science-models | cd06e9aad95a0bc6cc2a81871e567c88159b86d3 | [
"BSD-2-Clause"
] | null | null | null | """
These are the original functions for modeling insulin and carbs for the FDA loop risk analysis
written by Ed (with superficial modifications). They are here for reference and testing.
"""
import numpy as np
from tidepool_data_science_models.models.simple_metabolism_model import STEADY_STATE_IOB_FACTOR_FDA
def... | 30.201183 | 101 | 0.627155 |
f1505314eef374ce1b7cebf3c65b692d219c1017 | 1,076 | py | Python | nova/policies/image_size.py | viveknandavanam/nova | 556377b6915936467436c9d5bb33bc0e22244e1e | [
"Apache-2.0"
] | 1 | 2015-11-30T19:44:00.000Z | 2015-11-30T19:44:00.000Z | nova/policies/image_size.py | viveknandavanam/nova | 556377b6915936467436c9d5bb33bc0e22244e1e | [
"Apache-2.0"
] | 11 | 2017-06-19T01:28:55.000Z | 2017-06-23T02:01:47.000Z | nova/policies/image_size.py | viveknandavanam/nova | 556377b6915936467436c9d5bb33bc0e22244e1e | [
"Apache-2.0"
] | 3 | 2018-04-04T15:15:01.000Z | 2018-04-19T18:14:25.000Z | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... | 29.081081 | 78 | 0.729554 |
0f645f459c9bbd8f6b8427684f08752b746ea9d2 | 2,500 | py | Python | main.py | stevenraphael/pathsize | 981be00f08a6d3c2e07f480e827ed078111b3e46 | [
"MIT"
] | null | null | null | main.py | stevenraphael/pathsize | 981be00f08a6d3c2e07f480e827ed078111b3e46 | [
"MIT"
] | null | null | null | main.py | stevenraphael/pathsize | 981be00f08a6d3c2e07f480e827ed078111b3e46 | [
"MIT"
] | null | null | null | """
Usage:
main.py <path> [--top=<top>] [--nofiles]
main.py -h | --help
Options:
-h --help show this screen
--top=<top> how many of the largest items to show [default: 1000].
--nofiles excludes files in the path from being printed.
"""
import os, sys... | 32.051282 | 116 | 0.5648 |
811256eda4ed17632e5268ee45dbbda9f22608d4 | 31,378 | py | Python | heudiconv/tests/test_bids.py | neurorepro/heudiconv | a694f83204df3d3d7c0aa70be492253f9659367d | [
"Apache-2.0"
] | 1 | 2019-11-01T18:25:57.000Z | 2019-11-01T18:25:57.000Z | heudiconv/tests/test_bids.py | neurorepro/heudiconv | a694f83204df3d3d7c0aa70be492253f9659367d | [
"Apache-2.0"
] | 1 | 2021-06-21T20:42:25.000Z | 2021-06-21T21:30:42.000Z | heudiconv/tests/test_bids.py | neurorepro/heudiconv | a694f83204df3d3d7c0aa70be492253f9659367d | [
"Apache-2.0"
] | 2 | 2018-08-13T19:35:00.000Z | 2022-02-11T16:03:40.000Z | """Test functions in heudiconv.bids module.
"""
import re
import os
import os.path as op
from random import random
from datetime import (datetime,
timedelta,
)
from collections import (namedtuple,
OrderedDict,
)
from glob imp... | 38.126367 | 153 | 0.618969 |
16532b04692155bf7f8eb5cfafb62618641d6ef5 | 16,129 | py | Python | simulation/Growth_rate_under_both_effect_figure4AC.py | YuanxiaoGao/Evolution_of_reproductive_strategies_in_incipient_multicellularity | 13eb51639fcee630a76e197b50ef321e3a94ce0f | [
"MIT"
] | null | null | null | simulation/Growth_rate_under_both_effect_figure4AC.py | YuanxiaoGao/Evolution_of_reproductive_strategies_in_incipient_multicellularity | 13eb51639fcee630a76e197b50ef321e3a94ce0f | [
"MIT"
] | null | null | null | simulation/Growth_rate_under_both_effect_figure4AC.py | YuanxiaoGao/Evolution_of_reproductive_strategies_in_incipient_multicellularity | 13eb51639fcee630a76e197b50ef321e3a94ce0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 16 11:56:54 2019
@author: gao
"""
#-*-encoding:utf-8 -*-
################################################################
# 2018-06-25 #
################################################################
""" code description:
Aim: get ... | 38.130024 | 128 | 0.539339 |
bb52d97991aa92b0f056065eb4ebd1266985edfa | 10,555 | py | Python | snn_lib/utilities.py | zhongyuchen/snn-iir | 58f0cb4a0dfcf5be630543fdfd88741f6061bcac | [
"Apache-2.0"
] | 5 | 2021-03-10T11:57:43.000Z | 2022-03-02T13:15:45.000Z | snn_lib/utilities.py | zhongyuchen/snn-iir | 58f0cb4a0dfcf5be630543fdfd88741f6061bcac | [
"Apache-2.0"
] | null | null | null | snn_lib/utilities.py | zhongyuchen/snn-iir | 58f0cb4a0dfcf5be630543fdfd88741f6061bcac | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
# File Name : utilities.py
# Author: Haowen Fang
# Email: hfang02@syr.edu
# Description: utility functions.
"""
import random
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage import filters
import matplotlib
import torch
from torch.utils.data import Dataset, DataLoader... | 33.29653 | 110 | 0.672383 |
58a33dea0320154d39784a61316ecc953e1a009c | 1,682 | py | Python | data-science-onramp/data-ingestion/noxfile_config.py | InstantDomain/python-docs-samples | f8e293c722998b269da38b7fe11b98aae8932b8f | [
"Apache-2.0"
] | null | null | null | data-science-onramp/data-ingestion/noxfile_config.py | InstantDomain/python-docs-samples | f8e293c722998b269da38b7fe11b98aae8932b8f | [
"Apache-2.0"
] | null | null | null | data-science-onramp/data-ingestion/noxfile_config.py | InstantDomain/python-docs-samples | f8e293c722998b269da38b7fe11b98aae8932b8f | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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 agreed to in writing, ... | 42.05 | 88 | 0.737218 |
28dde302535868dd71d4a15da8a260061482dccd | 1,474 | py | Python | tests/sentry/api/endpoints/test_group_tagkey_details.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 2 | 2019-03-04T12:45:54.000Z | 2019-03-04T12:45:55.000Z | tests/sentry/api/endpoints/test_group_tagkey_details.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 196 | 2019-06-10T08:34:10.000Z | 2022-02-22T01:26:13.000Z | tests/sentry/api/endpoints/test_group_tagkey_details.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 1 | 2017-02-09T06:36:57.000Z | 2017-02-09T06:36:57.000Z | from __future__ import absolute_import
import six
from sentry import tagstore
from sentry.testutils import APITestCase
class GroupTagDetailsTest(APITestCase):
def test_simple(self):
group = self.create_group()
group.data['tags'] = (['foo', 'bar'], )
group.save()
key, value = gro... | 28.346154 | 71 | 0.571913 |
2130df02db838b0b8a27714d23b0f5d3a79e5cd2 | 38,850 | py | Python | src/optopus/_old.py | hindman/optopus | daaba31c6b1bd4f56e442326e36f7b3ea0b74b15 | [
"MIT"
] | 2 | 2021-05-04T23:44:42.000Z | 2021-07-25T20:45:33.000Z | src/optopus/_old.py | hindman/optopus | daaba31c6b1bd4f56e442326e36f7b3ea0b74b15 | [
"MIT"
] | null | null | null | src/optopus/_old.py | hindman/optopus | daaba31c6b1bd4f56e442326e36f7b3ea0b74b15 | [
"MIT"
] | null | null | null | import json
import re
import sys
import textwrap
from collections import defaultdict, OrderedDict
from six.moves.collections_abc import Iterable
from copy import deepcopy
from itertools import product
################
# Constants.
################
PATTERNS = dict(
simple = dict(
long_opt = r'--(\w[\w\-]... | 29.166667 | 102 | 0.512458 |
242baf05e2b4b56e61200bf5de764c6d0af73de2 | 70,674 | py | Python | src/transformers/utils/dummy_pt_objects.py | ashirviskas/transformers | 8a085169328b2be2bff6939199597c5515d997f5 | [
"Apache-2.0"
] | null | null | null | src/transformers/utils/dummy_pt_objects.py | ashirviskas/transformers | 8a085169328b2be2bff6939199597c5515d997f5 | [
"Apache-2.0"
] | null | null | null | src/transformers/utils/dummy_pt_objects.py | ashirviskas/transformers | 8a085169328b2be2bff6939199597c5515d997f5 | [
"Apache-2.0"
] | null | null | null | # This file is autogenerated by the command `make fix-copies`, do not edit.
from ..file_utils import requires_backends
class PyTorchBenchmark:
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])
class PyTorchBenchmarkArguments:
def __init__(self, *args, **kwargs):
require... | 24.286598 | 84 | 0.669737 |
ae45d495c68a509c9e1fbdcdad7be1a0e9747a14 | 6,661 | py | Python | rmgradient/test_rmgradient.py | drnc/rmgradient | 2bc3253b54661bf546e7742b646b5da897182d23 | [
"Apache-2.0"
] | null | null | null | rmgradient/test_rmgradient.py | drnc/rmgradient | 2bc3253b54661bf546e7742b646b5da897182d23 | [
"Apache-2.0"
] | null | null | null | rmgradient/test_rmgradient.py | drnc/rmgradient | 2bc3253b54661bf546e7742b646b5da897182d23 | [
"Apache-2.0"
] | null | null | null | import logging
import numpy
import rmgradient
import unittest
import os
import tifffile
def datafile(filename):
return os.path.join('test_data', filename)
def filereader(filename):
return rmgradient.TiffReader(datafile(filename))
def filewriter(filename):
return rmgradient.TiffWriter(datafile(filename))
... | 47.241135 | 120 | 0.67062 |
dc7b6bf696acd2a1fb5efabd7b446e7fbc6c30f5 | 617 | py | Python | nova/storage/__init__.py | bopopescu/nova-master | 58809056f3a219c6ea3667003f906eeaf581fa95 | [
"Apache-2.0"
] | 7 | 2017-06-19T19:37:00.000Z | 2019-06-16T02:06:14.000Z | nova/storage/__init__.py | bopopescu/nova-master | 58809056f3a219c6ea3667003f906eeaf581fa95 | [
"Apache-2.0"
] | null | null | null | nova/storage/__init__.py | bopopescu/nova-master | 58809056f3a219c6ea3667003f906eeaf581fa95 | [
"Apache-2.0"
] | 6 | 2015-06-20T16:07:28.000Z | 2020-08-19T14:57:59.000Z | # Copyright (c) 2013 Hewlett-Packard, 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... | 44.071429 | 78 | 0.724473 |
9aa95555ae11852ac31b8c213593949da8d6f245 | 13,435 | py | Python | thonny/plugins/replayer.py | webduino-cn/thonny | 74da2278aa018eafec697c2b92e2355237669ecd | [
"MIT"
] | null | null | null | thonny/plugins/replayer.py | webduino-cn/thonny | 74da2278aa018eafec697c2b92e2355237669ecd | [
"MIT"
] | 13 | 2018-11-15T09:31:06.000Z | 2019-11-22T18:16:54.000Z | thonny/plugins/replayer.py | webduino-cn/thonny | 74da2278aa018eafec697c2b92e2355237669ecd | [
"MIT"
] | 3 | 2018-11-24T14:00:30.000Z | 2019-07-02T02:32:26.000Z | import ast
import json
import os.path
import tkinter as tk
from datetime import datetime
from tkinter import ttk
from thonny import codeview, get_workbench, ui_utils, THONNY_USER_DIR
from thonny.base_file_browser import BaseLocalFileBrowser
from thonny.plugins.coloring import SyntaxColorer
from thonny.ui_utils import ... | 36.808219 | 97 | 0.627019 |
c0d9a88e13760e8cf59883c3a44871d1fe05b804 | 917 | py | Python | api/app/models/Product.py | ValerianThomas/Titanic_kaggle_in_production | 45cff05b32a0193f8e75f37a151c2a588c927a03 | [
"MIT"
] | null | null | null | api/app/models/Product.py | ValerianThomas/Titanic_kaggle_in_production | 45cff05b32a0193f8e75f37a151c2a588c927a03 | [
"MIT"
] | null | null | null | api/app/models/Product.py | ValerianThomas/Titanic_kaggle_in_production | 45cff05b32a0193f8e75f37a151c2a588c927a03 | [
"MIT"
] | null | null | null | from marshmallow import fields, Schema
from .. import db
class Product (db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), unique=True)
dscription = db.Column(db.String(200))
price = db.Column(db.Float)
qty = db.Column(db.Integer)
def __init__(self, name, d... | 26.2 | 54 | 0.642312 |
e8469cd04bf7b012811f67e712a4d81b7745285b | 578 | py | Python | api/apps/users/migrations/0002_auto_20170216_1234.py | Bibliotecaio/biblioteca | 584268b7615f2be5f011fad09b472ee8a06914e0 | [
"MIT"
] | null | null | null | api/apps/users/migrations/0002_auto_20170216_1234.py | Bibliotecaio/biblioteca | 584268b7615f2be5f011fad09b472ee8a06914e0 | [
"MIT"
] | null | null | null | api/apps/users/migrations/0002_auto_20170216_1234.py | Bibliotecaio/biblioteca | 584268b7615f2be5f011fad09b472ee8a06914e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-02-16 12:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 27.52381 | 194 | 0.624567 |
fd5944b095f1dde8522b8cedba321a5d8e4a3284 | 4,163 | py | Python | quizzes/00.organize.me/Cracking the Coding Interview/B_quickSort_comp.py | JiniousChoi/encyclopedia-in-code | 77bc551a03a2a3e3808e50016ece14adb5cfbd96 | [
"MIT"
] | 2 | 2018-07-20T10:15:49.000Z | 2018-07-20T10:16:54.000Z | quizzes/00.organize.me/Cracking the Coding Interview/B_quickSort_comp.py | JiniousChoi/encyclopedia-in-code | 77bc551a03a2a3e3808e50016ece14adb5cfbd96 | [
"MIT"
] | 2 | 2018-06-26T09:12:44.000Z | 2019-12-18T00:09:14.000Z | quizzes/00.organize.me/Cracking the Coding Interview/B_quickSort_comp.py | JiniousChoi/encyclopedia-in-code | 77bc551a03a2a3e3808e50016ece14adb5cfbd96 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
def quicksort_wrapper(arr, compare):
quicksort ( arr, 0, len(arr)-1, compare)
def quicksort(arr, start_idx, end_idx, compare):
#arr has no element
if end_idx - start_idx < 0:
return
#this part is not necessary.
#it just prevent one more needless recursive in-ste... | 27.753333 | 89 | 0.576027 |
230e696b17532fa772b1bfc645df4e0dce425242 | 1,157 | py | Python | cffex/cffex/spiders/cffex.py | rahrahr/CrawlCffex | 419a42c0fa70d9c04adcc19a01020011dc2acd56 | [
"MIT"
] | null | null | null | cffex/cffex/spiders/cffex.py | rahrahr/CrawlCffex | 419a42c0fa70d9c04adcc19a01020011dc2acd56 | [
"MIT"
] | null | null | null | cffex/cffex/spiders/cffex.py | rahrahr/CrawlCffex | 419a42c0fa70d9c04adcc19a01020011dc2acd56 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
from cffex.items import CffexItem
import datetime
class CffexSpider(scrapy.Spider):
name = 'cffex'
start_urls = ['http://www.cffex.com.cn/lssjxz/']
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/... | 38.566667 | 161 | 0.554019 |
57b31d6c3b21d5e2ab256afd9ab3fd595c4be4d8 | 1,612 | py | Python | friend.py | sharyar/friend-dir | d6a5e77157b2e2d50ba23bd981a8e2c60efcb781 | [
"MIT"
] | null | null | null | friend.py | sharyar/friend-dir | d6a5e77157b2e2d50ba23bd981a8e2c60efcb781 | [
"MIT"
] | null | null | null | friend.py | sharyar/friend-dir | d6a5e77157b2e2d50ba23bd981a8e2c60efcb781 | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from datetime import date
@dataclass
class Friend:
fname : str = None
lname : str = None
phone : str = None
birthdate: date = None
def __post_init__(self):
if self.birthdate != None:
self.birthdate = date.fromisoformat(self.bi... | 31.607843 | 98 | 0.585608 |
d9978c23fabd0bf26a9cec7ead776bb8318494db | 1,374 | py | Python | ooobuild/dyn/xml/crypto/xxml_signature.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/xml/crypto/xxml_signature.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/xml/crypto/xxml_signature.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 37.135135 | 86 | 0.766376 |
f89c280656480bd7b6c8defa2846a9ce6c8364cd | 25 | py | Python | cride/circles/views/__init__.py | mariogonzcardona/platzi-cride | 40da9489de8339816dcb18db59f46daa851f6236 | [
"MIT"
] | null | null | null | cride/circles/views/__init__.py | mariogonzcardona/platzi-cride | 40da9489de8339816dcb18db59f46daa851f6236 | [
"MIT"
] | 1 | 2020-05-28T18:31:48.000Z | 2020-05-28T18:31:48.000Z | cride/circles/views/__init__.py | mariogonzcardona/platzi-cride | 40da9489de8339816dcb18db59f46daa851f6236 | [
"MIT"
] | null | null | null | # from .circles import *
| 12.5 | 24 | 0.68 |
1124e5aa4e2cc0af4ca1a3903ad3056321e6d44e | 1,898 | py | Python | setup.py | renovate-tests/cs251-toolkit | fc1dbc85e04083116a985ab1bd5314a60125f038 | [
"MIT"
] | null | null | null | setup.py | renovate-tests/cs251-toolkit | fc1dbc85e04083116a985ab1bd5314a60125f038 | [
"MIT"
] | null | null | null | setup.py | renovate-tests/cs251-toolkit | fc1dbc85e04083116a985ab1bd5314a60125f038 | [
"MIT"
] | null | null | null | import sys
from setuptools import setup, find_packages
if sys.version_info < (3, 5):
sys.exit("The toolkit requires Python 3.5 or greater.\nYou have {}".format(sys.version_info))
setup(
name='cs251tk',
version='2.5.0',
description='The CS251 (Software Design) Toolkit',
author='Hawken Rives',
a... | 33.892857 | 97 | 0.602213 |
6acc708d8f95a62cd3a468300bf2eab3d6c8a0db | 816 | py | Python | features/steps/mark.py | rvodden/minisculus | 097f0be1e061c1e313d929e1d71c17c2a402d71c | [
"MIT"
] | null | null | null | features/steps/mark.py | rvodden/minisculus | 097f0be1e061c1e313d929e1d71c17c2a402d71c | [
"MIT"
] | null | null | null | features/steps/mark.py | rvodden/minisculus | 097f0be1e061c1e313d929e1d71c17c2a402d71c | [
"MIT"
] | null | null | null | from behave import given
from behave.runner import Context
from minisculus import MarkOne, MarkTwo
@given("a mark one machine with its wheel set to {}")
def a_mark_one_machine_with_its_wheel_set_to(context: Context, wheel_value: int):
"""
Args:
context: The feature context.
wheel_value: The v... | 29.142857 | 81 | 0.703431 |
890cc2af4dd286f050f998f73df0709ed4b1aa87 | 78 | py | Python | server/cleanIpCore/consts.py | Rexarrior/NetworkUtility | 37ebe95aa46462ab5fe2dfe83320c95fe404abd3 | [
"Apache-2.0"
] | null | null | null | server/cleanIpCore/consts.py | Rexarrior/NetworkUtility | 37ebe95aa46462ab5fe2dfe83320c95fe404abd3 | [
"Apache-2.0"
] | 3 | 2022-02-13T15:00:05.000Z | 2022-02-27T05:56:34.000Z | server/cleanIpCore/consts.py | Rexarrior/NetworkUtility | 37ebe95aa46462ab5fe2dfe83320c95fe404abd3 | [
"Apache-2.0"
] | null | null | null |
S_BASE_IP = '0.0.0.0'
S_MIN_PORT = 8001
S_MAX_PORT = 9001
S_MAX_COUNT = 1000
| 13 | 21 | 0.717949 |
c6b835dcfb7fc8904c662a0272b4ffd6884e763b | 2,850 | py | Python | Lib/site-packages/chainer/functions/array/where.py | km-t/dcpython | c0fcd5557691004d7d9d22a662d90e52ecc5f34f | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/site-packages/chainer/functions/array/where.py | km-t/dcpython | c0fcd5557691004d7d9d22a662d90e52ecc5f34f | [
"CNRI-Python-GPL-Compatible"
] | 11 | 2020-01-28T22:49:05.000Z | 2022-03-11T23:50:27.000Z | Lib/site-packages/chainer/functions/array/where.py | km-t/dcpython | c0fcd5557691004d7d9d22a662d90e52ecc5f34f | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | import numpy
import chainer
from chainer import backend
from chainer import function_node
from chainer.utils import type_check
class Where(function_node.FunctionNode):
"""Choose elements depending on condition."""
def __init__(self, condition):
self.condition = condition
def check_type_forward... | 32.022472 | 74 | 0.581404 |
5fd6b4fd3380ddf6d390e4a47ce8bebd32e17a4f | 5,095 | py | Python | algorithm/utils/img_utils.py | danromuald/sagemaker-pytorch-neural-style | 19699d998b45c13f37820f76924bacc8ef6185a4 | [
"MIT"
] | null | null | null | algorithm/utils/img_utils.py | danromuald/sagemaker-pytorch-neural-style | 19699d998b45c13f37820f76924bacc8ef6185a4 | [
"MIT"
] | null | null | null | algorithm/utils/img_utils.py | danromuald/sagemaker-pytorch-neural-style | 19699d998b45c13f37820f76924bacc8ef6185a4 | [
"MIT"
] | null | null | null | ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Hang Zhang
## ECE Department, Rutgers University
## Email: zhang.hang@rutgers.edu
## Copyright (c) 2017
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this sou... | 31.067073 | 95 | 0.603337 |
55511ae80d3da305a2a40ae768ef99ea9e106a54 | 1,294 | py | Python | fixture/session.py | daryarudi/python_training | a9b85bc33a21d1fc23c4a1701e0886cdb909d9b2 | [
"Apache-2.0"
] | null | null | null | fixture/session.py | daryarudi/python_training | a9b85bc33a21d1fc23c4a1701e0886cdb909d9b2 | [
"Apache-2.0"
] | null | null | null | fixture/session.py | daryarudi/python_training | a9b85bc33a21d1fc23c4a1701e0886cdb909d9b2 | [
"Apache-2.0"
] | null | null | null | class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").clear()
wd.find_element_by_name("user").send_keys(username)
wd.find_element_by_name("pass... | 30.093023 | 73 | 0.608964 |
146968526a84184862201a5d9f4788b6e828abb3 | 2,051 | py | Python | library_collection/migrations/0002_add_note_fields.py | amywieliczka/avram | 1956130fcde464acf3ed00432a597dd857647e91 | [
"Unlicense"
] | null | null | null | library_collection/migrations/0002_add_note_fields.py | amywieliczka/avram | 1956130fcde464acf3ed00432a597dd857647e91 | [
"Unlicense"
] | 5 | 2015-02-17T18:53:27.000Z | 2020-12-09T22:36:41.000Z | library_collection/migrations/0002_add_note_fields.py | amywieliczka/avram | 1956130fcde464acf3ed00432a597dd857647e91 | [
"Unlicense"
] | 1 | 2022-02-25T15:22:40.000Z | 2022-02-25T15:22:40.000Z | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('library_collection', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='collection',
name='date_last_harvested',
... | 32.555556 | 128 | 0.577279 |
147e084f6badd2ef58552945d5d1824c34fa803a | 2,749 | py | Python | config/rfam_local_template.py | mb1069/rfam-production | 10c76e249dc22d30862b3a873fd54f390e859ad8 | [
"Apache-2.0"
] | 1 | 2020-01-14T12:12:46.000Z | 2020-01-14T12:12:46.000Z | config/rfam_local_template.py | mb1069/rfam-production | 10c76e249dc22d30862b3a873fd54f390e859ad8 | [
"Apache-2.0"
] | null | null | null | config/rfam_local_template.py | mb1069/rfam-production | 10c76e249dc22d30862b3a873fd54f390e859ad8 | [
"Apache-2.0"
] | null | null | null | """
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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 la... | 22.532787 | 80 | 0.484176 |
2db1b6c6816c58fe69da5d46f41860f5e7f3201b | 1,444 | py | Python | src/main/python/systemds/operator/algorithm/builtin/logSumExp.py | shiruke/systemds | cdd7b9ca15c3f17ec15045e85b107e26a4d7e7a7 | [
"Apache-2.0"
] | null | null | null | src/main/python/systemds/operator/algorithm/builtin/logSumExp.py | shiruke/systemds | cdd7b9ca15c3f17ec15045e85b107e26a4d7e7a7 | [
"Apache-2.0"
] | null | null | null | src/main/python/systemds/operator/algorithm/builtin/logSumExp.py | shiruke/systemds | cdd7b9ca15c3f17ec15045e85b107e26a4d7e7a7 | [
"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 unde... | 38 | 76 | 0.703601 |
6835c4124dadd2b3f1b93ac3f4c22d14eaf48465 | 412 | py | Python | read_trace.py | SillyTin/erays | be8768f280de174400050afc267bb5f3987042d0 | [
"MIT"
] | 79 | 2018-08-17T19:02:09.000Z | 2022-03-29T21:17:43.000Z | read_trace.py | catageek/erayscan | 141e160879e79a752c8d321af0a43f707a1106e4 | [
"MIT"
] | 3 | 2018-08-29T16:40:07.000Z | 2021-03-20T02:47:54.000Z | read_trace.py | catageek/erayscan | 141e160879e79a752c8d321af0a43f707a1106e4 | [
"MIT"
] | 20 | 2018-08-20T21:05:20.000Z | 2022-03-02T15:15:20.000Z | import sys, json
line = open(sys.argv[1]).readline()
info = json.loads(line)
trace = info['result']['structLogs']
for step in trace:
if step['depth'] != 1:
continue
for i, item in enumerate(step['stack']):
print("$s%d:\t%s" % (i, hex(int(item, 16))[2:]))
for i in step['memory']:
print(i)
# print("".join(ste... | 22.888889 | 50 | 0.582524 |
d3a26d77e09f4e0bef46cb5ce6d8351db5f3d673 | 4,891 | py | Python | docs/conf.py | kwp-communications/jicket | f01325e4ac736c41962fe11c8ae5587a18c542ec | [
"MIT"
] | 6 | 2018-10-10T08:42:37.000Z | 2018-10-15T15:52:18.000Z | docs/conf.py | kwp-communications/jicket | f01325e4ac736c41962fe11c8ae5587a18c542ec | [
"MIT"
] | 1 | 2018-10-01T08:39:11.000Z | 2018-10-10T08:44:03.000Z | docs/conf.py | kwp-communications/jicket | f01325e4ac736c41962fe11c8ae5587a18c542ec | [
"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.56875 | 79 | 0.644245 |
15a6b941ba2b4647d7dc7f1dcf9a5dddfbefa70c | 2,082 | py | Python | mri_works/NodeEditor/python/classForProbe.py | montigno/mri_works | 8ec6ff1500aa34d3540e44e4b0148023cf821f61 | [
"CECILL-B"
] | 2 | 2020-08-20T21:00:53.000Z | 2021-08-16T15:28:51.000Z | mri_works/NodeEditor/python/classForProbe.py | montigno/mri_works | 8ec6ff1500aa34d3540e44e4b0148023cf821f61 | [
"CECILL-B"
] | 3 | 2020-09-24T06:50:43.000Z | 2020-12-15T11:02:04.000Z | mri_works/NodeEditor/python/classForProbe.py | montigno/mri_works | 8ec6ff1500aa34d3540e44e4b0148023cf821f61 | [
"CECILL-B"
] | 1 | 2020-08-20T21:00:59.000Z | 2020-08-20T21:00:59.000Z | from prompt_toolkit import print_formatted_text, ANSI
class printProbe():
def __init__(self, unit, lab, format, label, val):
if 'int' in format:
col = '\x1b[94m'
elif 'float' in format:
col = '\x1b[33m'
elif 'tuple' in format:
col = '\x1b[98m'
e... | 34.131148 | 89 | 0.370797 |
7d8066edfe1ee7f7c81ac6e7a52838d7929dca84 | 1,510 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/jdfusion/models/EipAddress.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/jdfusion/models/EipAddress.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/jdfusion/models/EipAddress.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 35.952381 | 148 | 0.696026 |
9aee5367e305ec1e733f3ae8f04c07f50adde6e6 | 451 | py | Python | contest/abc144/D.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | contest/abc144/D.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | contest/abc144/D.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | import math
def main():
a, b, x = map(int, input().split())
# 水平時の高さを求める
h = x / a ** 2
rad = 0
if h >= (b / 2):
# 高さが半分以上
# 水のない三角形部分の高さを求める
u = (a * a * b - x) * 2 / a ** 2
rad = math.atan(u / a)
else:
# 高さが半分以下
# 水部分の三角形の高さを求める
u = x /... | 18.04 | 40 | 0.439024 |
2ebe31b33e9645d999f468b593f5b563639d5cfb | 136 | py | Python | schema/setup.py | dafarz/base-service | 95791beac06c1ac58e0fa2050aa2cf3a3a22d8d7 | [
"MIT"
] | null | null | null | schema/setup.py | dafarz/base-service | 95791beac06c1ac58e0fa2050aa2cf3a3a22d8d7 | [
"MIT"
] | null | null | null | schema/setup.py | dafarz/base-service | 95791beac06c1ac58e0fa2050aa2cf3a3a22d8d7 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='schema',
packages=find_packages(),
install_requires=['pydantic']
) | 19.428571 | 43 | 0.720588 |
81d018b255615cd7b04c8c91410ae4765d2e3bc5 | 1,120 | py | Python | Machine_Learning/Project/Bryan/scratch/1P/LR.py | bnonni/Python | 9ebd18caa4e2d805028b557e8b77ea65a9ee1a3d | [
"Apache-2.0"
] | 4 | 2019-10-05T03:41:20.000Z | 2020-11-04T00:39:13.000Z | Machine_Learning/Project/Bryan/scratch/1P/LR.py | bnonni/Python | 9ebd18caa4e2d805028b557e8b77ea65a9ee1a3d | [
"Apache-2.0"
] | null | null | null | Machine_Learning/Project/Bryan/scratch/1P/LR.py | bnonni/Python | 9ebd18caa4e2d805028b557e8b77ea65a9ee1a3d | [
"Apache-2.0"
] | 2 | 2019-10-02T14:08:51.000Z | 2019-10-03T20:49:09.000Z | #!/usr/bin/env python3
import gc
import warnings
import gc, sys, re, os, math
from time import strptime, mktime
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
gc.collect()
warnings.filterwarnings('ignore')
np.random.seed(1)
# %matplotlib inline
from sklearn.linear_model import LogisticRegression... | 33.939394 | 114 | 0.685714 |
59d0d39e3456700c34f0ffe28ace5f59fc3a0bb2 | 15,216 | py | Python | capriqorn/postproc/filter/solvent_matching.py | bio-phys/capriqorn | 8f514deaf301643a38a4d101e3ada1ae10a1abc6 | [
"CC-BY-4.0"
] | 8 | 2018-03-29T09:48:20.000Z | 2021-04-14T10:12:49.000Z | capriqorn/postproc/filter/solvent_matching.py | bio-phys/capriqorn | 8f514deaf301643a38a4d101e3ada1ae10a1abc6 | [
"CC-BY-4.0"
] | 5 | 2018-05-28T11:29:17.000Z | 2018-06-15T04:54:10.000Z | capriqorn/postproc/filter/solvent_matching.py | bio-phys/capriqorn | 8f514deaf301643a38a4d101e3ada1ae10a1abc6 | [
"CC-BY-4.0"
] | 1 | 2021-03-10T12:25:31.000Z | 2021-03-10T12:25:31.000Z | # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# Capriqorn --- CAlculation of P(R) and I(Q) Of macRomolcules in solutioN
#
# Copyright (c) Juergen Koefinger, Klaus Reuter, and contributors.
# See the file AUTHORS.rst f... | 49.402597 | 125 | 0.492902 |
e59bc7b43765bd36683fc3a23743122a9018ec5c | 17,375 | py | Python | openshift/client/models/v1_build_status.py | TristanCacqueray/openshift-restclient-python | 7758cde7a8094acb279904f15c29e5fe3e9f7d33 | [
"Apache-2.0"
] | null | null | null | openshift/client/models/v1_build_status.py | TristanCacqueray/openshift-restclient-python | 7758cde7a8094acb279904f15c29e5fe3e9f7d33 | [
"Apache-2.0"
] | null | null | null | openshift/client/models/v1_build_status.py | TristanCacqueray/openshift-restclient-python | 7758cde7a8094acb279904f15c29e5fe3e9f7d33 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenShift API (with Kubernetes)
OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is... | 39.850917 | 3,325 | 0.660317 |
6e93bd33a400727dc8b069619071b9edf9b24116 | 6,672 | py | Python | interactive.py | edbltn/fairseq | e4d25fd96f1e38190400dbbdbc77eeda71ac50a0 | [
"BSD-3-Clause"
] | 1 | 2019-02-13T13:05:07.000Z | 2019-02-13T13:05:07.000Z | interactive.py | edbltn/fairseq | e4d25fd96f1e38190400dbbdbc77eeda71ac50a0 | [
"BSD-3-Clause"
] | null | null | null | interactive.py | edbltn/fairseq | e4d25fd96f1e38190400dbbdbc77eeda71ac50a0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Trans... | 34.391753 | 113 | 0.639988 |
0fbb4dc16718d87f9c32bdded9af49206c3dceda | 313 | py | Python | 001/two_sum.py | codeestX/re-zero-leetcode-life | 30295074af018aa25fb69010e58273f934459a5a | [
"MIT"
] | null | null | null | 001/two_sum.py | codeestX/re-zero-leetcode-life | 30295074af018aa25fb69010e58273f934459a5a | [
"MIT"
] | null | null | null | 001/two_sum.py | codeestX/re-zero-leetcode-life | 30295074af018aa25fb69010e58273f934459a5a | [
"MIT"
] | null | null | null | class Solution:
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
d = {}
for i, num in enumerate(nums):
if target - num in d:
return [d[target - num], i]
d[num] = i
| 24.076923 | 43 | 0.43131 |
e549b61db56cd3537a7d3e1e5535d22957220fb3 | 2,352 | py | Python | kornia/color/adjust.py | timaebi/kornia | 4710234128d7d830cd020c45df8eb17870d4e939 | [
"Apache-2.0"
] | 10 | 2021-01-26T05:25:01.000Z | 2022-02-08T06:10:41.000Z | kornia/color/adjust.py | sounakdey/kornia | 6a0df6dee7b213572ff3441bb6eb0e07a23f0ef3 | [
"Apache-2.0"
] | 3 | 2021-05-03T10:34:15.000Z | 2022-02-17T04:25:26.000Z | kornia/color/adjust.py | sounakdey/kornia | 6a0df6dee7b213572ff3441bb6eb0e07a23f0ef3 | [
"Apache-2.0"
] | 4 | 2021-04-30T01:51:38.000Z | 2022-01-27T05:06:04.000Z | import torch
import torch.nn as nn
class AdjustBrightness(nn.Module):
r"""Adjust Brightness of an Image
See :class:`~kornia.color.AdjustBrightness` for details.
Args:
image (torch.Tensor): Image to be adjusted.
brightness_factor (torch.Tensor): Brightness adjust factor per element
... | 33.126761 | 79 | 0.641156 |
3b9a2294f4c91a109787b4f3fba38779d4363459 | 6,618 | py | Python | dojo/tools/zap/parser.py | christophe226/django-DefectDojo | 0ea0a59526ee9169dce29777288cf9dba0c44263 | [
"BSD-3-Clause"
] | null | null | null | dojo/tools/zap/parser.py | christophe226/django-DefectDojo | 0ea0a59526ee9169dce29777288cf9dba0c44263 | [
"BSD-3-Clause"
] | 562 | 2019-06-21T18:44:38.000Z | 2022-03-28T18:09:08.000Z | dojo/tools/zap/parser.py | christophe226/django-DefectDojo | 0ea0a59526ee9169dce29777288cf9dba0c44263 | [
"BSD-3-Clause"
] | null | null | null |
import re
import socket
import hyperlink
from defusedxml import ElementTree as ET
from django.utils.html import escape, strip_tags
from dojo.models import Endpoint, Finding
class ZapParser(object):
"""Parser for xml file generated by the OWASP Zed Attacl Proxy (ZAP) tool https://www.zaproxy.org/."""
def ge... | 33.424242 | 116 | 0.551526 |
d9fb4aa1b95166e7835358ecfff44a304633bcff | 4,179 | py | Python | model.py | lbilic/testrep | ad228b03ba9f9620d239ad446a173911b2486cbb | [
"MIT"
] | null | null | null | model.py | lbilic/testrep | ad228b03ba9f9620d239ad446a173911b2486cbb | [
"MIT"
] | null | null | null | model.py | lbilic/testrep | ad228b03ba9f9620d239ad446a173911b2486cbb | [
"MIT"
] | null | null | null |
import numpy as np
import os
import skimage.io as io
import skimage.transform as trans
import numpy as np
from keras.models import *
from keras.layers import *
from keras.optimizers import *
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras import backend as keras
smooth = 1.
def dice_c... | 54.272727 | 137 | 0.663795 |
8edfdfeb57d96b0b6c6bbc91dba12c28f12cbf27 | 14,634 | py | Python | collagen/data/_splitter.py | MIPT-Oulu/Collagen | 0cbc4285d60e5c9fcc89f629fcf4321e80b7452c | [
"MIT"
] | 4 | 2019-05-14T14:44:51.000Z | 2020-03-13T08:37:48.000Z | collagen/data/_splitter.py | MIPT-Oulu/Collagen | 0cbc4285d60e5c9fcc89f629fcf4321e80b7452c | [
"MIT"
] | 26 | 2019-04-21T20:35:22.000Z | 2022-03-12T00:32:57.000Z | collagen/data/_splitter.py | MIPT-Oulu/Collagen | 0cbc4285d60e5c9fcc89f629fcf4321e80b7452c | [
"MIT"
] | 1 | 2019-05-14T14:53:28.000Z | 2019-05-14T14:53:28.000Z | import dill as pickle
import pandas as pd
from sklearn import model_selection
from sklearn.utils import resample
__all__ = ["Splitter", "FoldSplit", "TrainValSplit", "SSFoldSplit"]
class Splitter(object):
def __init__(self):
self.__ds_chunks = None
self.__folds_iter = None
pass
def _... | 50.116438 | 158 | 0.581522 |
1941665601464012f3615c914147755e3be12f17 | 164 | py | Python | addons/Sprytile-6b68d00/rx/core/py3/observable.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | 733 | 2017-08-22T09:47:54.000Z | 2022-03-27T23:56:52.000Z | rx/core/py3/observable.py | asheraryam/Sprytile | c63be50d14b07192ff134ceab256f0d69b9c4c92 | [
"MIT"
] | 74 | 2017-08-16T09:13:05.000Z | 2022-03-15T02:31:49.000Z | rx/core/py3/observable.py | asheraryam/Sprytile | c63be50d14b07192ff134ceab256f0d69b9c4c92 | [
"MIT"
] | 77 | 2017-09-14T16:56:11.000Z | 2022-03-27T13:55:16.000Z | from abc import ABCMeta, abstractmethod
class Observable(metaclass=ABCMeta):
@abstractmethod
def subscribe(self, observer):
return NotImplemented
| 20.5 | 39 | 0.75 |
84fda62c5bca3716c062db0c002a6018068640e4 | 2,351 | py | Python | chatterbox/api/instagram.py | blitzagency/django-chatterbox | 7bf17444f8308aa12b6718bd62ee1344021c21aa | [
"MIT"
] | 8 | 2015-03-10T20:03:09.000Z | 2018-06-14T23:03:58.000Z | chatterbox/api/instagram.py | blitzagency/django-chatterbox | 7bf17444f8308aa12b6718bd62ee1344021c21aa | [
"MIT"
] | 3 | 2015-07-14T22:44:47.000Z | 2020-06-05T23:43:05.000Z | chatterbox/api/instagram.py | blitzagency/django-chatterbox | 7bf17444f8308aa12b6718bd62ee1344021c21aa | [
"MIT"
] | null | null | null | import logging
from six.moves.urllib.parse import urlencode
from . import OAuth2Api, SimpleProfile
log = logging.getLogger(__name__)
class Instagram(OAuth2Api):
def verify_parsed_response(self, data):
pass
def whoami(self):
log.debug("Invoking whoami")
return self.get("https://api.... | 30.141026 | 82 | 0.598043 |
c6be5754043618abb850c65da3bed2c43529021d | 3,034 | py | Python | models/enconder_decoder.py | hitfee01/Yolo3D | e9a73f66b948311013b190ce1065e4abf595f206 | [
"MIT"
] | 9 | 2021-01-22T01:21:15.000Z | 2022-03-23T06:06:08.000Z | models/enconder_decoder.py | hitfee01/Yolo3D | e9a73f66b948311013b190ce1065e4abf595f206 | [
"MIT"
] | 7 | 2021-01-07T05:33:58.000Z | 2022-03-24T06:14:11.000Z | models/enconder_decoder.py | hitfee01/Yolo3D | e9a73f66b948311013b190ce1065e4abf595f206 | [
"MIT"
] | 5 | 2021-03-27T08:28:05.000Z | 2022-02-13T14:10:41.000Z |
import torch
import torch.nn as nn
import numpy as np
from models.MultiBin import MultiBin
class Coder(object):
def __init__(self, dim_ref):
super(Coder, self).__init__()
self.multibin = MultiBin(2, 0.1)
self.dim_ref = torch.tensor(dim_ref, dtype=torch.float32)
@torch.no_grad()
... | 39.402597 | 113 | 0.648649 |
a7b449c2f9c52ebb4e8d47deb65bb51efcc9b241 | 1,761 | py | Python | tapsdk/backends/dotnet/inputmodes.py | jnunez101/tap-python-sdk | a2481dd53db255f09d066db97c5582180ded0f6c | [
"MIT"
] | 22 | 2020-03-01T04:41:48.000Z | 2021-12-27T17:10:55.000Z | tapsdk/backends/dotnet/inputmodes.py | jnunez101/tap-python-sdk | a2481dd53db255f09d066db97c5582180ded0f6c | [
"MIT"
] | 16 | 2020-02-25T05:10:45.000Z | 2022-01-12T16:05:30.000Z | tapsdk/backends/dotnet/inputmodes.py | jnunez101/tap-python-sdk | a2481dd53db255f09d066db97c5582180ded0f6c | [
"MIT"
] | 16 | 2020-02-22T20:35:30.000Z | 2021-12-31T14:36:07.000Z | import logging
import clr
import System
clr.AddReference(r"tapsdk/backends/dotnet/TAPWin")
from TAPWin import TAPInputMode
from TAPWin import RawSensorSensitivity
class TapInputMode:
def __init__(self, mode, sensitivity: list=[0, 0, 0]):
self._modes = {
"text" : {"name": "Text Mode", "cod... | 44.025 | 172 | 0.62067 |
b93f87e5bc0586cd04ec367024e7c36594767618 | 858 | py | Python | src/setup.py | mingrammer/pyshark | 30923f08c347c7f63510b9c0db24ac2cd7e932ee | [
"MIT"
] | 1 | 2021-01-06T21:22:35.000Z | 2021-01-06T21:22:35.000Z | src/setup.py | mingrammer/pyshark | 30923f08c347c7f63510b9c0db24ac2cd7e932ee | [
"MIT"
] | null | null | null | src/setup.py | mingrammer/pyshark | 30923f08c347c7f63510b9c0db24ac2cd7e932ee | [
"MIT"
] | null | null | null | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.txt')) as f:
long_description = f.read()
setup(
name="pyshark",
version="0.4.2.3",
packages=find_packages(),
package_data={'': ['*.ini', '*.pcapng']},
install_requires=['lxml', 'py',... | 31.777778 | 103 | 0.653846 |
7ffa50cb3374767d0d55680432bc803a9a2abd6c | 693 | py | Python | flask_center/app.py | iamjeerge/vision-platform | aac82798c392b4fc55592020fec59dd53a326d37 | [
"MIT"
] | null | null | null | flask_center/app.py | iamjeerge/vision-platform | aac82798c392b4fc55592020fec59dd53a326d37 | [
"MIT"
] | 1 | 2021-04-04T12:59:24.000Z | 2021-04-04T12:59:24.000Z | flask_center/app.py | iamjeerge/vision-platform | aac82798c392b4fc55592020fec59dd53a326d37 | [
"MIT"
] | null | null | null | import os
import sys
from flask import Flask
from flask_jwt_extended import JWTManager
from flask_restful import Api
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
api = Api(app)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config[... | 22.354839 | 64 | 0.76912 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.