hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
84111fc4b75c1fe1656b0d3636d05c5119254c18 | 587 | py | Python | mathgenerator/funcs/computer_science/binary_complement_1s.py | Sankari-K/mathgenerator | 712c74fbe34fe594c4c0f7e3b3057b01d85112ba | [
"MIT"
] | 40 | 2020-10-14T17:29:51.000Z | 2020-11-01T04:41:03.000Z | mathgenerator/funcs/computer_science/binary_complement_1s.py | Sankari-K/mathgenerator | 712c74fbe34fe594c4c0f7e3b3057b01d85112ba | [
"MIT"
] | 209 | 2020-10-14T15:32:08.000Z | 2020-11-03T19:08:19.000Z | mathgenerator/funcs/computer_science/binary_complement_1s.py | Sankari-K/mathgenerator | 712c74fbe34fe594c4c0f7e3b3057b01d85112ba | [
"MIT"
] | 179 | 2020-10-14T15:36:55.000Z | 2020-10-29T19:26:16.000Z | from .__init__ import *
def gen_func(maxDigits=10, format='string'):
question = ''
answer = ''
for i in range(random.randint(1, maxDigits)):
temp = str(random.randint(0, 1))
question += temp
answer += "0" if temp == "1" else "1"
if format == 'string':
problem = questi... | 24.458333 | 60 | 0.558773 |
4606e66b9e6c59650682a116a3ea97d45f10df3b | 8,646 | py | Python | caesar_cypher/ps6.py | NicholasJarr/6.00.1x | b2398e4de45ab415cf0f6ae9edae7936f45361dd | [
"MIT"
] | null | null | null | caesar_cypher/ps6.py | NicholasJarr/6.00.1x | b2398e4de45ab415cf0f6ae9edae7936f45361dd | [
"MIT"
] | null | null | null | caesar_cypher/ps6.py | NicholasJarr/6.00.1x | b2398e4de45ab415cf0f6ae9edae7936f45361dd | [
"MIT"
] | null | null | null | import string
### DO NOT MODIFY THIS FUNCTION ###
def load_words(file_name):
'''
file_name (string): the name of the file containing
the list of words to load
Returns: a list of valid words. Words are strings of lowercase letters.
Depending on the size of the word list, this function ma... | 34.309524 | 157 | 0.628036 |
45e73e8a71859914b79df4b1c78edef6f342016d | 3,653 | py | Python | madcore/cmdminikube.py | madcore-ai/cli | cfa530b001014f31058d1310eab14939a3086c67 | [
"MIT"
] | 12 | 2017-01-18T13:09:29.000Z | 2020-02-14T19:32:45.000Z | madcore/cmdminikube.py | madcore-ai/cli | cfa530b001014f31058d1310eab14939a3086c67 | [
"MIT"
] | 63 | 2017-01-10T09:51:33.000Z | 2021-06-01T21:20:16.000Z | madcore/cmdminikube.py | madcore-ai/cli | cfa530b001014f31058d1310eab14939a3086c67 | [
"MIT"
] | 4 | 2018-05-04T17:39:49.000Z | 2021-03-24T09:00:58.000Z | """
MIT License
Copyright (c) 2016-2018 Madcore Ltd
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, publi... | 40.142857 | 295 | 0.71147 |
ffafe3f0f2104d25de985debbc1d8796e5c9b797 | 24,380 | py | Python | optimizer/layout_quality.py | santala/layout-server | 59d02a5cfc31295c7ac5db4e3c8dc0dc370422d4 | [
"MIT"
] | null | null | null | optimizer/layout_quality.py | santala/layout-server | 59d02a5cfc31295c7ac5db4e3c8dc0dc370422d4 | [
"MIT"
] | null | null | null | optimizer/layout_quality.py | santala/layout-server | 59d02a5cfc31295c7ac5db4e3c8dc0dc370422d4 | [
"MIT"
] | null | null | null | from typing import List
from itertools import combinations, product
from math import ceil, factorial, floor, sqrt
from collections import namedtuple
from gurobipy import GRB, GenExpr, LinExpr, Model, tupledict, abs_, and_, max_, min_, QuadExpr, GurobiError
from .classes import Layout, Element
def solve(layout: Layo... | 42.179931 | 124 | 0.570755 |
0ac7eed084d65269470f541c04d87ab847be2dae | 1,113 | py | Python | lists_to_one_space_string.py | danilomine01/Projects-and-Examples_Automate-the-Boring-Stuff-with-Python- | 4aa2942a37d945d7c394662de9f13ccd708f1662 | [
"CC-BY-3.0"
] | null | null | null | lists_to_one_space_string.py | danilomine01/Projects-and-Examples_Automate-the-Boring-Stuff-with-Python- | 4aa2942a37d945d7c394662de9f13ccd708f1662 | [
"CC-BY-3.0"
] | null | null | null | lists_to_one_space_string.py | danilomine01/Projects-and-Examples_Automate-the-Boring-Stuff-with-Python- | 4aa2942a37d945d7c394662de9f13ccd708f1662 | [
"CC-BY-3.0"
] | null | null | null | '''pasar de lista de strings a frase de una sola estring
%Write a function that takes a list value as an argument and returns
%a string with all the items separated by a comma and a space, with and
%inserted before the last item. For example, passing the previous spam list to
%the function would return 'apples, ... | 35.903226 | 91 | 0.673854 |
9f27a5b66b1458aa4027384a5a9d661249cdff8e | 3,186 | py | Python | test/test.py | kiziebar/pysitcom | bcc9abc47826d0cbf8be124783f4a89db6501efe | [
"MIT"
] | 1 | 2020-11-29T20:57:09.000Z | 2020-11-29T20:57:09.000Z | test/test.py | kiziebar/pysitcom | bcc9abc47826d0cbf8be124783f4a89db6501efe | [
"MIT"
] | null | null | null | test/test.py | kiziebar/pysitcom | bcc9abc47826d0cbf8be124783f4a89db6501efe | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from pysitcom import Comet, Sitcom
class TestComet(unittest.TestCase):
def test_criteriaFail(self):
with self.assertRaises(TypeError):
Comet(["Bad", 0.5, 1])
def test_criteriaType(self):
with self.assertRaises(TypeError):
... | 31.544554 | 56 | 0.539548 |
7ed78ae76e1971c5e1edf07b7dbc1c8e1d2a0881 | 4,843 | py | Python | userbot/plugins/whois.py | n8wachT/telegrrrrrr | ad254bda0710c1a38dae21f84a45cf94031fa66d | [
"MIT"
] | null | null | null | userbot/plugins/whois.py | n8wachT/telegrrrrrr | ad254bda0710c1a38dae21f84a45cf94031fa66d | [
"MIT"
] | null | null | null | userbot/plugins/whois.py | n8wachT/telegrrrrrr | ad254bda0710c1a38dae21f84a45cf94031fa66d | [
"MIT"
] | null | null | null | """Get Telegram Profile Picture and other information
Syntax: .whois @username"""
import html
from telethon.tl.functions.photos import GetUserPhotosRequest
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import MessageEntityMentionName
from telethon.utils import get_input_location
fro... | 34.841727 | 91 | 0.62771 |
e9ee909c82e0ece7de18904a5894e11412768b9e | 1,210 | py | Python | create_tables.py | JaySRT/ETL_for_DWH_on_Redshift | 566834af2158d1526e73c1a2e334f9c17b18b66e | [
"MIT"
] | 1 | 2022-02-11T21:19:42.000Z | 2022-02-11T21:19:42.000Z | create_tables.py | JaySRT/ETL_for_DWH_on_Redshift | 566834af2158d1526e73c1a2e334f9c17b18b66e | [
"MIT"
] | null | null | null | create_tables.py | JaySRT/ETL_for_DWH_on_Redshift | 566834af2158d1526e73c1a2e334f9c17b18b66e | [
"MIT"
] | null | null | null | import configparser
import psycopg2
from sql_queries import create_table_queries, drop_table_queries
def drop_tables(cur, conn):
"""
The Function drops tables if they exist before ETL process
Parameters:
cur: Database cursor.
conn: Database connection.
Returns:
None
... | 18.90625 | 112 | 0.605785 |
811656557372fc8b35c11aeb187ad28ec2c5c826 | 2,138 | py | Python | pyWeights.py | softwarespartan/pyStk | d37bb2acdee3fc62972e8ff51363588af060db1f | [
"MIT"
] | null | null | null | pyWeights.py | softwarespartan/pyStk | d37bb2acdee3fc62972e8ff51363588af060db1f | [
"MIT"
] | null | null | null | pyWeights.py | softwarespartan/pyStk | d37bb2acdee3fc62972e8ff51363588af060db1f | [
"MIT"
] | null | null | null |
import numpy as np;
import scipy.stats as stats;
def ipr(dv,percentile=None):
# compute the (I)nter(P)ercentile(R)ange
if percentile == None:
percentile = 50.0;
u_ip = stats.scoreatpercentile(dv[~np.isnan(dv)], 100 - percentile/2);
l_ip = stats.scoreatpercentile(dv[~np.isnan(dv... | 28.131579 | 79 | 0.525257 |
7645c0ccd166d18fb863b54e0bda3102675ff111 | 982 | py | Python | python-lib/dku_stress_test_center/utils.py | dataiku/dss-plugin-stress-test-center | 2134c12388de7a343070eb7fc212a77b32b60124 | [
"Apache-2.0"
] | null | null | null | python-lib/dku_stress_test_center/utils.py | dataiku/dss-plugin-stress-test-center | 2134c12388de7a343070eb7fc212a77b32b60124 | [
"Apache-2.0"
] | 19 | 2021-05-04T12:44:29.000Z | 2022-01-21T15:49:24.000Z | python-lib/dku_stress_test_center/utils.py | dataiku/dss-plugin-stress-test-center | 2134c12388de7a343070eb7fc212a77b32b60124 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from drift_dac.covariate_shift import MissingValues, Scaling
from drift_dac.prior_shift import Rebalance
class DkuStressTestCenterConstants(object):
FEATURE_PERTURBATION = "FEATURE_PERTURBATION"
SUBPOPULATION_SHIFT = "SUBPOPULATION_SHIFT"
TARGET_SHIFT = "TARGET_SHIFT"
TESTS = ... | 32.733333 | 98 | 0.711813 |
9aac2f5e18f31378e8a49dc1b49cd95c87062eff | 2,932 | py | Python | pwndbg/wrappers/readelf.py | chubbymaggie/pwndbg | add270c47d6a5c9c2e92938696c2c70011e9b051 | [
"MIT"
] | null | null | null | pwndbg/wrappers/readelf.py | chubbymaggie/pwndbg | add270c47d6a5c9c2e92938696c2c70011e9b051 | [
"MIT"
] | null | null | null | pwndbg/wrappers/readelf.py | chubbymaggie/pwndbg | add270c47d6a5c9c2e92938696c2c70011e9b051 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import pwndbg.wrappers
cmd_name = "readelf"
@pwndbg.wrappers.OnlyWithCommand(cmd_name)
def get_jmpslots():
... | 35.325301 | 96 | 0.588336 |
0e64f734bd0c497d44bac28a93709564ee85a4c9 | 2,659 | py | Python | tensorflow_examples/lite/model_maker/demo/image_classification_demo_test.py | ObservantLabs/examples | 0c95cc2201245728d32a44ccd33cd5daad17ae25 | [
"Apache-2.0"
] | 1 | 2020-03-25T13:41:09.000Z | 2020-03-25T13:41:09.000Z | tensorflow_examples/lite/model_maker/demo/image_classification_demo_test.py | ObservantLabs/examples | 0c95cc2201245728d32a44ccd33cd5daad17ae25 | [
"Apache-2.0"
] | 4 | 2021-06-08T22:04:44.000Z | 2022-03-12T00:41:52.000Z | tensorflow_examples/lite/model_maker/demo/image_classification_demo_test.py | ObservantLabs/examples | 0c95cc2201245728d32a44ccd33cd5daad17ae25 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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... | 34.089744 | 106 | 0.74276 |
5f9b2a6c5d8bcc12f12280411b751f7a212b1d93 | 2,425 | py | Python | setka/pipes/optimization/LossHandler.py | RomanovMikeV/setka | cad6f17429a4bb3479c5557ad58c15fee568f410 | [
"MIT"
] | 11 | 2019-04-16T11:41:24.000Z | 2021-05-28T15:01:17.000Z | setka/pipes/optimization/LossHandler.py | RomanovMikeV/cv_utilities | cad6f17429a4bb3479c5557ad58c15fee568f410 | [
"MIT"
] | 15 | 2019-12-05T22:25:37.000Z | 2020-03-18T20:09:03.000Z | setka/pipes/optimization/LossHandler.py | RomanovMikeV/setka | cad6f17429a4bb3479c5557ad58c15fee568f410 | [
"MIT"
] | 6 | 2019-04-24T15:35:22.000Z | 2021-08-10T07:48:39.000Z | import torch
from setka.pipes.Pipe import Pipe
from copy import deepcopy
class LossHandler(Pipe):
"""
Handles loss functions.
Stores:
self.trainer._loss -- loss value for the model
Args:
criterion (callable, list of callable): loss function or list of loss functions
coefs (l... | 38.492063 | 114 | 0.612784 |
29025a431d151273c48624cb070632e1efaa02ca | 1,103 | py | Python | gym/envs/F16/AeroBenchVVPython/code/cx.py | caffett/gym | a9126ace2488acfaa63544ad14859d530ee4ac76 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/envs/F16/AeroBenchVVPython/code/cx.py | caffett/gym | a9126ace2488acfaa63544ad14859d530ee4ac76 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/envs/F16/AeroBenchVVPython/code/cx.py | caffett/gym | a9126ace2488acfaa63544ad14859d530ee4ac76 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | '''
Stanley Bak
Python F-16 GCAS
cx
'''
import numpy as np
from util import fix, sign
def cx(alpha, el):
'cx definition'
a = np.array([[-.099, -.081, -.081, -.063, -.025, .044, .097, .113, .145, .167, .174, .166], \
[-.048, -.038, -.040, -.021, .016, .083, .127, .137, .162, .177, .179, .167], \
... | 21.627451 | 102 | 0.393472 |
5a7b7b2a3d722ff2929a007940a99dffec3cb43d | 5,994 | py | Python | tests/test_get_posts.py | barakplasma/facebook-scraper | a6af938639b2b0320fe64311169c7001f6500f98 | [
"MIT"
] | 1 | 2020-06-30T11:46:02.000Z | 2020-06-30T11:46:02.000Z | tests/test_get_posts.py | barakplasma/facebook-scraper | a6af938639b2b0320fe64311169c7001f6500f98 | [
"MIT"
] | null | null | null | tests/test_get_posts.py | barakplasma/facebook-scraper | a6af938639b2b0320fe64311169c7001f6500f98 | [
"MIT"
] | null | null | null | import datetime
import pytest
from facebook_scraper import get_posts
@pytest.mark.vcr()
class TestGetPosts:
def test_get_posts(self):
expected_post = {
'comments': 73,
'image': 'https://scontent.faqp2-3.fna.fbcdn.net/v/t1.0-9/fr/cp0/e15/q65/96724875_3065146506903115_4237164853036... | 40.77551 | 326 | 0.584918 |
803e59f6302fd7cafd2d498d96f13e8f124589b8 | 2,464 | py | Python | source/vsm-dashboard/vsm_dashboard/context_processors.py | ramkrsna/virtual-storage-manager | 78125bfb4dd4d78ff96bc3274c8919003769c545 | [
"Apache-2.0"
] | 172 | 2015-01-07T08:40:17.000Z | 2019-02-18T07:01:11.000Z | source/vsm-dashboard/vsm_dashboard/context_processors.py | ramkrsna/virtual-storage-manager | 78125bfb4dd4d78ff96bc3274c8919003769c545 | [
"Apache-2.0"
] | 83 | 2015-03-06T07:47:03.000Z | 2018-07-05T15:10:19.000Z | source/vsm-dashboard/vsm_dashboard/context_processors.py | ramkrsna/virtual-storage-manager | 78125bfb4dd4d78ff96bc3274c8919003769c545 | [
"Apache-2.0"
] | 125 | 2015-01-05T12:22:15.000Z | 2019-02-18T07:01:39.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | 35.2 | 78 | 0.684659 |
e1f62a969c70c7898502fb01ee85ff4c384ee9c2 | 2,846 | py | Python | web/app/syzygy/items/schema.py | aaronSchanck/SepTech | 323b7db183928b43576b0f13477fccdd192fd3fa | [
"Apache-2.0"
] | 1 | 2021-09-10T17:51:40.000Z | 2021-09-10T17:51:40.000Z | web/app/syzygy/items/schema.py | ItsmeCurly/SepTech | 323b7db183928b43576b0f13477fccdd192fd3fa | [
"Apache-2.0"
] | 2 | 2021-04-30T15:57:12.000Z | 2021-05-01T17:55:51.000Z | web/app/syzygy/items/schema.py | ItsmeCurly/SepTech | 323b7db183928b43576b0f13477fccdd192fd3fa | [
"Apache-2.0"
] | 1 | 2021-09-10T17:51:10.000Z | 2021-09-10T17:51:10.000Z | """/web/app/syzygy/items/schema.py
Author: Adam Green (adam.green1@maine.edu)
[Description]
Classes:
[ClassesList]
Functions:
[FunctionsList]
"""
import logging
import marshmallow as ma
from app.ma_fields import FileStorageField
from marshmallow import Schema, fields
from marshmallow_sqlalchemy import ... | 25.185841 | 81 | 0.728039 |
110c1aa38b6e70bd2a18fe0698a2aa1858085c57 | 2,559 | py | Python | src/models/generative/LFRTEST/LFR_reader.py | zhanghuijun-hello/A-framework-for-evaluating-community-mining-algorithms.- | 41ba38513b0b62d7837979de9de68abb475f9db2 | [
"MIT"
] | 1 | 2019-06-13T20:18:51.000Z | 2019-06-13T20:18:51.000Z | src/models/generative/LFRTEST/LFR_reader.py | zhanghuijun-hello/A-framework-for-evaluating-community-mining-algorithms.- | 41ba38513b0b62d7837979de9de68abb475f9db2 | [
"MIT"
] | null | null | null | src/models/generative/LFRTEST/LFR_reader.py | zhanghuijun-hello/A-framework-for-evaluating-community-mining-algorithms.- | 41ba38513b0b62d7837979de9de68abb475f9db2 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from igraph import *
# read network
def read_graph(name):
g = Graph.Read_Edgelist(name, directed=False)
return g
# read ground-truth communities
def read_communities(name):
# g = Graph.Read_Edgelist(name, directed=True)
# return g.es
res = []
... | 30.464286 | 113 | 0.573662 |
b6d2b9616a63d586ad20d831ea9738e6774639ed | 1,639 | py | Python | aim/db/migration/alembic_migrations/versions/74f15b6aee51_endpoint.py | gaurav-dalvi/aci-integration-module | 5d31f65f4fca3e0322d6003e7736ca14aa7ec72d | [
"Apache-2.0"
] | 7 | 2017-11-20T12:45:36.000Z | 2021-11-14T12:52:48.000Z | aim/db/migration/alembic_migrations/versions/74f15b6aee51_endpoint.py | gaurav-dalvi/aci-integration-module | 5d31f65f4fca3e0322d6003e7736ca14aa7ec72d | [
"Apache-2.0"
] | 92 | 2016-03-30T04:48:18.000Z | 2022-01-19T21:25:27.000Z | aim/db/migration/alembic_migrations/versions/74f15b6aee51_endpoint.py | gaurav-dalvi/aci-integration-module | 5d31f65f4fca3e0322d6003e7736ca14aa7ec72d | [
"Apache-2.0"
] | 11 | 2017-12-23T15:55:24.000Z | 2021-08-03T12:59:33.000Z | # Copyright (c) 2016 Cisco Systems
# 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 require... | 30.924528 | 78 | 0.685174 |
035513fea0e6309e9165fa42e83503766a327835 | 6,114 | py | Python | edcnlp/utils/tokenizer.py | edchengg/MyNLP | 350c14efebc1440d6e132c6c516f0a02625df320 | [
"MIT"
] | 1 | 2021-10-31T21:40:25.000Z | 2021-10-31T21:40:25.000Z | edcnlp/utils/tokenizer.py | edchengg/MyNLP | 350c14efebc1440d6e132c6c516f0a02625df320 | [
"MIT"
] | null | null | null | edcnlp/utils/tokenizer.py | edchengg/MyNLP | 350c14efebc1440d6e132c6c516f0a02625df320 | [
"MIT"
] | null | null | null | import itertools
def whitespace_tokenize(text):
"""Runs basic whitespace cleaning and splitting on a piece of text."""
text = text.strip()
if not text:
return []
tokens = text.split()
return tokens
def character_offset(sentence, tokens):
# Given a sentence in string and tokenized versi... | 34.738636 | 105 | 0.604187 |
74e0c14026fd92c0ba713fddb9da834c8cee24a9 | 1,976 | py | Python | example.py | Lancher/increasing | 7a5e0a27edfe5f471ee44872ea58a93647958cfa | [
"MIT"
] | 3 | 2018-01-05T14:26:20.000Z | 2020-02-19T03:16:17.000Z | example.py | Lancher/increasing | 7a5e0a27edfe5f471ee44872ea58a93647958cfa | [
"MIT"
] | null | null | null | example.py | Lancher/increasing | 7a5e0a27edfe5f471ee44872ea58a93647958cfa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
from increasing import ProgressBar
p = ProgressBar([
{
'type': 'text'
},
{
'cols': 40,
'type': 'basic',
'open_symbol': '\033[1m\033[38;5;1m[\033[0m',
'close_symbol': '\033[1m\033[38;5;1m]\033[0m',... | 25.012658 | 76 | 0.447368 |
4a97d8ef8a17bfbe927e229fef1c9f65f80676a2 | 1,457 | py | Python | cp2k_xyz_input.py | aslarsen/CP2K_scripts | 88d4431b740bcfc477efedfcc7cff7767ec79b50 | [
"MIT"
] | null | null | null | cp2k_xyz_input.py | aslarsen/CP2K_scripts | 88d4431b740bcfc477efedfcc7cff7767ec79b50 | [
"MIT"
] | null | null | null | cp2k_xyz_input.py | aslarsen/CP2K_scripts | 88d4431b740bcfc477efedfcc7cff7767ec79b50 | [
"MIT"
] | null | null | null | import sys
def read_xyzfile(xyzfile):
models = []
f = open(xyzfile, 'r')
model = []
for line in f:
if len(line.split()) == 1:
if len(model) != 0:
models.append(model)
model = []
model.append(line.replace('\n',''))
else:
... | 23.5 | 98 | 0.551132 |
b39ab701458602d3e5f831bd9a1b92c5ad8508d1 | 2,007 | py | Python | configs/config_BiCLSTM_in_unet.py | dkswxd/unetpp_pytorch_qiu | df439b07d13c5d8c87975f0cca4dd7a5ff19f8c2 | [
"Apache-2.0"
] | null | null | null | configs/config_BiCLSTM_in_unet.py | dkswxd/unetpp_pytorch_qiu | df439b07d13c5d8c87975f0cca4dd7a5ff19f8c2 | [
"Apache-2.0"
] | null | null | null | configs/config_BiCLSTM_in_unet.py | dkswxd/unetpp_pytorch_qiu | df439b07d13c5d8c87975f0cca4dd7a5ff19f8c2 | [
"Apache-2.0"
] | null | null | null |
from collections import OrderedDict
config_name = 'BiCLSTM_in_unet'
config_dataset = OrderedDict([
('dataset', 'hyper'),
('channels', 60),
('n_class', 2),
('norm_kwargs', {'type':'data'}),
('npy_dir', '../cancer/npy/'),
('label_dir', '../cancer/label/'),
('train_split', '../cancer/split/s... | 30.409091 | 93 | 0.607872 |
22a58b7c08d215d910b44157d681ef5212fed8d9 | 813 | py | Python | hardhat/recipes/git_crypt.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/git_crypt.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/git_crypt.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | import os
import shutil
from .base import GnuRecipe
class GitCryptRecipe(GnuRecipe):
def __init__(self, *args, **kwargs):
super(GitCryptRecipe, self).__init__(*args, **kwargs)
self.sha256 = '0a8f92c0a0a125bf768d0c054d947ca4' \
'e4b8d6556454b0e7e87fb907ee17cf06'
self.... | 31.269231 | 74 | 0.618696 |
37464aad318de2d6b130bfd344d200a56009005f | 53,116 | py | Python | kats/tests/test_consts.py | ryilkici/Kats | 45afa6fd86cd2d5ac83ae846d6c36a159501b3bf | [
"MIT"
] | null | null | null | kats/tests/test_consts.py | ryilkici/Kats | 45afa6fd86cd2d5ac83ae846d6c36a159501b3bf | [
"MIT"
] | null | null | null | kats/tests/test_consts.py | ryilkici/Kats | 45afa6fd86cd2d5ac83ae846d6c36a159501b3bf | [
"MIT"
] | 1 | 2021-11-30T02:36:40.000Z | 2021-11-30T02:36:40.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import io
import os
import pkgutil
from datetime import datetime
from unittest import TestCase
import numpy as np
import pandas as pd
import py... | 40.795699 | 88 | 0.619719 |
3b1588548ab59a0184382d60a9d7792f277cd9b0 | 755 | py | Python | doc/.src/book/src/nitsche.py | hplgit/fem-book | c23099715dc3cb72e7f4d37625e6f9614ee5fc4e | [
"MIT"
] | 86 | 2015-12-17T12:57:11.000Z | 2022-03-26T01:53:47.000Z | src/nitsche.py | mbarzegary/finite-element-intro | 47ef0a3592b823ae71a874ee35850114f16b6d8b | [
"MIT"
] | 9 | 2017-04-16T21:57:29.000Z | 2021-04-17T08:09:30.000Z | doc/.src/book/src/nitsche.py | hplgit/fem-book | c23099715dc3cb72e7f4d37625e6f9614ee5fc4e | [
"MIT"
] | 43 | 2016-03-11T19:33:14.000Z | 2022-03-05T00:21:57.000Z | import matplotlib.pyplot as plt
from dolfin import *
mesh = UnitIntervalMesh(100)
V = FunctionSpace(mesh, "Lagrange", 1)
u = TrialFunction(V)
v = TestFunction(V)
lams = [1.001, 1.01, 1.1, 2, 10, 100]
for lam in lams:
lam = Constant(lam)
h = CellDiameter(mesh)
n = FacetNormal(mesh)
f = Expression... | 25.166667 | 66 | 0.57351 |
6471380732d3000e9c6c5882580c44934fba9e05 | 23,121 | py | Python | rsscrawler/sites/sf.py | 9Mad-Max5/RSScrawler | f9f690ed990edb524be0d4921a3bc569365eafca | [
"MIT"
] | 1 | 2020-01-23T16:54:44.000Z | 2020-01-23T16:54:44.000Z | rsscrawler/sites/sf.py | 9Mad-Max5/RSScrawler | f9f690ed990edb524be0d4921a3bc569365eafca | [
"MIT"
] | null | null | null | rsscrawler/sites/sf.py | 9Mad-Max5/RSScrawler | f9f690ed990edb524be0d4921a3bc569365eafca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# RSScrawler
# Projekt von https://github.com/rix1337
import datetime
import hashlib
import json
import re
from bs4 import BeautifulSoup
from rsscrawler.common import add_decrypt
from rsscrawler.common import check_hoster
from rsscrawler.common import check_valid_release
from rsscrawler.commo... | 49.722581 | 119 | 0.460231 |
8e752ea891cda532cb7a6b52c89ba07aa8ba785b | 16,989 | py | Python | proteus/tests/solver_tests/import_modules/NavierStokes_ST_LS_SO_VV.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | null | null | null | proteus/tests/solver_tests/import_modules/NavierStokes_ST_LS_SO_VV.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 13 | 2018-02-08T23:22:59.000Z | 2020-12-06T19:40:32.000Z | proteus/tests/solver_tests/import_modules/NavierStokes_ST_LS_SO_VV.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 1 | 2020-02-17T03:25:34.000Z | 2020-02-17T03:25:34.000Z | from proteus.TransportCoefficients import TwophaseNavierStokes_ST_LS_SO as TPNSE_ST_LS_SO
class NavierStokes_ST_LS_SO_VV(TPNSE_ST_LS_SO):
'''This coefficients class is specially designed to allow a time
varying viscosity parameter. The purpose of this is to allow us
to use a pseudo-continuity approa... | 66.885827 | 216 | 0.140856 |
2c39241b83f02985ebdaf088b514ac38cd67dfcd | 13,395 | py | Python | label_studio/server.py | sarangpande1996/label-studio | 0c7c6c3b7f8d8528ca5561334366760c614bf0fa | [
"Apache-2.0"
] | 3 | 2021-07-16T03:48:21.000Z | 2022-01-10T04:58:25.000Z | label_studio/server.py | sarangpande1996/label-studio | 0c7c6c3b7f8d8528ca5561334366760c614bf0fa | [
"Apache-2.0"
] | null | null | null | label_studio/server.py | sarangpande1996/label-studio | 0c7c6c3b7f8d8528ca5561334366760c614bf0fa | [
"Apache-2.0"
] | null | null | null | """This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
"""
import sys
import logging
import socket
import pathlib
import os
import io
import json
import getpass
from colorama import init, Fore
if sys.platf... | 34.97389 | 168 | 0.640836 |
e8fdf269ff99eccbbbcb6c53b468a279773cbfdd | 4,536 | py | Python | test/test_product_pdf_color_profile_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | test/test_product_pdf_color_profile_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | test/test_product_pdf_color_profile_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
tweak-api
Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.
OpenAPI spec version: 1.0.8-beta.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
... | 28.35 | 165 | 0.684303 |
1aabd1f436d2e1e815dbf9e9f1620250832422e8 | 165 | py | Python | pymydb/config.py | adarsh2397/PyMyDb | bab9951b81fd2826299361469fa663ccdae6c6da | [
"MIT"
] | 2 | 2017-09-20T04:54:14.000Z | 2018-04-17T05:03:16.000Z | pymydb/config.py | adarsh2397/PyMyDb | bab9951b81fd2826299361469fa663ccdae6c6da | [
"MIT"
] | null | null | null | pymydb/config.py | adarsh2397/PyMyDb | bab9951b81fd2826299361469fa663ccdae6c6da | [
"MIT"
] | null | null | null | # Contains a list of Configuration variables
config = {
'host' : 'localhost',
'user' : 'root',
'password' : 'root',
'database' : 'trial_database',
} | 20.625 | 44 | 0.593939 |
be49399b30c5f1af90e42dbb1a469e1af6c30118 | 8,760 | py | Python | examples/text-classification/run_tf_glue.py | johntiger1/transformers | 38fadb6faf30c103531fa5fcd52b3f110e7582d0 | [
"Apache-2.0"
] | 67 | 2021-06-09T01:34:23.000Z | 2022-03-29T08:40:39.000Z | examples/text-classification/run_tf_glue.py | johntiger1/transformers | 38fadb6faf30c103531fa5fcd52b3f110e7582d0 | [
"Apache-2.0"
] | 13 | 2021-08-22T04:05:55.000Z | 2022-03-29T08:19:23.000Z | examples/text-classification/run_tf_glue.py | johntiger1/transformers | 38fadb6faf30c103531fa5fcd52b3f110e7582d0 | [
"Apache-2.0"
] | 8 | 2021-06-09T06:13:15.000Z | 2022-03-27T09:28:52.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Team. 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 requir... | 32.808989 | 133 | 0.673973 |
fd4f47ac77b0862ed61e31cda76433a13ca66f7f | 66,472 | py | Python | tensorflow/python/keras/engine/network_test.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 12 | 2020-12-28T18:42:10.000Z | 2022-03-24T17:34:21.000Z | tensorflow/python/keras/engine/network_test.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 2 | 2021-08-25T16:14:24.000Z | 2022-02-10T02:58:17.000Z | tensorflow/python/keras/engine/network_test.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 3 | 2020-03-09T19:17:02.000Z | 2020-06-26T23:14:31.000Z | # Copyright 2016 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... | 36.323497 | 80 | 0.668026 |
f9276a3730fd55b2fd5d5568c79d178e7f1ed10e | 10,604 | py | Python | spectrochempy/core/readers/readmatlab.py | dcambie/spectrochempy | e376082d66be7a4c528b7d83be076d77534e39bd | [
"CECILL-B"
] | 3 | 2021-04-09T09:13:21.000Z | 2022-01-09T00:05:42.000Z | spectrochempy/core/readers/readmatlab.py | fernandezc/spectrochempy | 4707c51dba0032c160afc40682fa16d4b9855ded | [
"CECILL-B"
] | null | null | null | spectrochempy/core/readers/readmatlab.py | fernandezc/spectrochempy | 4707c51dba0032c160afc40682fa16d4b9855ded | [
"CECILL-B"
] | null | null | null | # -*- coding: utf-8 -*-
# ======================================================================================================================
# Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France. =
# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See ful... | 39.129151 | 120 | 0.518012 |
8d9e33db2e5872f261003a1192f38bb45a495933 | 366 | py | Python | basics/__init__.py | huangtao1208/scrapy_spider | 7917daff727bf21be7bfe95e6f7d69773d13a5da | [
"MIT"
] | 58 | 2018-04-16T14:46:08.000Z | 2022-03-31T08:23:53.000Z | basics/__init__.py | huangtao1208/scrapy_spider | 7917daff727bf21be7bfe95e6f7d69773d13a5da | [
"MIT"
] | null | null | null | basics/__init__.py | huangtao1208/scrapy_spider | 7917daff727bf21be7bfe95e6f7d69773d13a5da | [
"MIT"
] | 15 | 2018-04-17T03:12:44.000Z | 2020-10-30T23:16:04.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# **********************************************************
# * Author : huangtao
# * Email : huangtao@yimian.me
# * Create time : 2018/5/20 下午5:36
# * Last modified : 2018/5/20 下午5:36
# * Filename : __init__.py.py
# * Description :
# ************... | 33.272727 | 60 | 0.374317 |
3aaaeb9b598d58d7d1603ccc006823b0d2b5b376 | 2,604 | py | Python | autocnet/cg/tests/test_cg.py | readthedocs-assistant/autocnet | 579cccd0edc4cd870b5d9671165ebd830f1112b8 | [
"CC0-1.0"
] | 17 | 2016-11-21T17:07:18.000Z | 2022-01-16T06:14:04.000Z | autocnet/cg/tests/test_cg.py | readthedocs-assistant/autocnet | 579cccd0edc4cd870b5d9671165ebd830f1112b8 | [
"CC0-1.0"
] | 504 | 2015-12-17T18:46:11.000Z | 2021-12-17T19:19:49.000Z | autocnet/cg/tests/test_cg.py | readthedocs-assistant/autocnet | 579cccd0edc4cd870b5d9671165ebd830f1112b8 | [
"CC0-1.0"
] | 42 | 2015-12-09T15:30:15.000Z | 2022-02-24T04:47:46.000Z | import os
import sys
import numpy as np
import pandas as pd
from autocnet.cg import cg
from osgeo import ogr
from shapely.geometry import Polygon
from unittest.mock import Mock, MagicMock
from plio.io import io_gdal
from autocnet.graph.node import Node
from autocnet.graph.network import CandidateGraph
from autocnet.... | 31 | 78 | 0.653226 |
80fbda46839ff1e3f655e4703d7f6c8894275b6b | 236 | py | Python | babybuddy/settings/ci.py | loic5/babybuddy | 86cf78e9fce15dc5396c2bb785a85f468c869c66 | [
"BSD-2-Clause"
] | 480 | 2020-02-07T21:28:24.000Z | 2022-03-29T03:03:56.000Z | babybuddy/settings/ci.py | loic5/babybuddy | 86cf78e9fce15dc5396c2bb785a85f468c869c66 | [
"BSD-2-Clause"
] | 287 | 2020-02-07T05:58:14.000Z | 2022-03-31T04:19:54.000Z | babybuddy/settings/ci.py | loic5/babybuddy | 86cf78e9fce15dc5396c2bb785a85f468c869c66 | [
"BSD-2-Clause"
] | 116 | 2020-02-08T16:23:47.000Z | 2022-03-31T02:47:49.000Z | from .base import *
SECRET_KEY = 'CISECRETKEYIGUESS'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
| 23.6 | 77 | 0.779661 |
dd4a7c9312dda923596d45e651f1448b13a2e233 | 3,016 | py | Python | ipc/communicator.py | bbartman/CHAMP_Battlebox | 83ebda7cc89823133b4b7b965b363a6a383694bf | [
"Apache-2.0"
] | null | null | null | ipc/communicator.py | bbartman/CHAMP_Battlebox | 83ebda7cc89823133b4b7b965b363a6a383694bf | [
"Apache-2.0"
] | null | null | null | ipc/communicator.py | bbartman/CHAMP_Battlebox | 83ebda7cc89823133b4b7b965b363a6a383694bf | [
"Apache-2.0"
] | null | null | null | import socket
import asyncio
import aiohttp
import sys
import os
from kivy.config import Config
from kivy.logger import Logger
class InstructionServer:
def _remove_prev_socket(self, addr):
try:
os.unlink(addr)
except OSError:
if os.path.exists(addr):
raise
... | 37.7 | 95 | 0.617042 |
c1f28408256d4ee974a8d3a2beade0ce4abf4188 | 6,398 | py | Python | mqbench/fake_quantize/lsq.py | thb1314/mqbench-openvino | 476d64a18a009fa5c001895343929c0332224e1a | [
"Apache-2.0"
] | 3 | 2022-02-05T12:10:07.000Z | 2022-02-09T03:04:58.000Z | mqbench/fake_quantize/lsq.py | thb1314/mqbench-openvino | 476d64a18a009fa5c001895343929c0332224e1a | [
"Apache-2.0"
] | null | null | null | mqbench/fake_quantize/lsq.py | thb1314/mqbench-openvino | 476d64a18a009fa5c001895343929c0332224e1a | [
"Apache-2.0"
] | 1 | 2022-02-07T04:47:03.000Z | 2022-02-07T04:47:03.000Z | from functools import partial
import torch
from torch.nn.parameter import Parameter
from mqbench.fake_quantize.quantize_base import QuantizeBase
from mqbench.utils import is_symmetric_quant, is_tracing_state
class LearnableFakeQuantize(QuantizeBase):
r""" This is an extension of the FakeQuantize module in fake_... | 48.469697 | 132 | 0.623789 |
e9486a0b74f00575032e824d6ee2363831e4bbc0 | 3,202 | py | Python | mythx_models/response/issue.py | ConsenSys/mythx-models | e912c2fc6e7d18041310d3b9f0f95085db47ed9b | [
"MIT"
] | null | null | null | mythx_models/response/issue.py | ConsenSys/mythx-models | e912c2fc6e7d18041310d3b9f0f95085db47ed9b | [
"MIT"
] | null | null | null | mythx_models/response/issue.py | ConsenSys/mythx-models | e912c2fc6e7d18041310d3b9f0f95085db47ed9b | [
"MIT"
] | null | null | null | """This module contains domain models regrading found issues."""
from typing import Any, Dict, List, Optional, Tuple, Union
from enum import Enum
from pydantic import BaseModel, Field
try:
from typing_extensions import Literal
except ImportError:
from typing import Literal
Severity = Union[
Literal["Unk... | 23.895522 | 100 | 0.617114 |
3abcb103495ecdd19749b0fb21336b030b36ad45 | 709 | py | Python | contrib/seeds/makeseeds.py | zahidaliayub/javacoin | 22f4c277aba8804d351997732c407c1917d60e39 | [
"MIT"
] | 4 | 2018-01-18T18:50:03.000Z | 2021-10-09T18:00:31.000Z | contrib/seeds/makeseeds.py | zahidaliayub/javacoin | 22f4c277aba8804d351997732c407c1917d60e39 | [
"MIT"
] | 1 | 2018-01-14T14:47:14.000Z | 2018-02-19T21:49:23.000Z | contrib/seeds/makeseeds.py | zahidaliayub/javacoin | 22f4c277aba8804d351997732c407c1917d60e39 | [
"MIT"
] | 1 | 2018-04-06T10:40:04.000Z | 2018-04-06T10:40:04.000Z | #!/usr/bin/env python
#
# Generate pnSeed[] from Pieter's DNS seeder
#
NSEEDS=600
import re
import sys
from subprocess import check_output
def main():
lines = sys.stdin.readlines()
ips = []
pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}):18303")
for line in lines:
m = patt... | 21.484848 | 78 | 0.509168 |
6814dd76c9edb2592944d4bd60e1deb8d9a40953 | 466 | py | Python | TemperatureSensor.py | majorpeter/puha-manager | fd51b560a7e1dad99204ae3c9c7369d17cbcfd32 | [
"MIT"
] | null | null | null | TemperatureSensor.py | majorpeter/puha-manager | fd51b560a7e1dad99204ae3c9c7369d17cbcfd32 | [
"MIT"
] | 5 | 2018-07-29T19:55:27.000Z | 2018-09-08T17:39:48.000Z | TemperatureSensor.py | majorpeter/puha-manager | fd51b560a7e1dad99204ae3c9c7369d17cbcfd32 | [
"MIT"
] | null | null | null | from datetime import timedelta
from LoggedSensor import LoggedSensor
class TemperatureSensor(LoggedSensor):
def __init__(self, node):
super(TemperatureSensor, self).__init__(type_id=1, max_measurements=500, holdoff_time=timedelta(minutes=1))
node.Temperature.subscribe_to_changes(self.on_property... | 31.066667 | 115 | 0.763948 |
eeef24093e67c6f2b25b097ae20e1994d77b3d7d | 31,930 | py | Python | torcharrow/velox_rt/numerical_column_cpu.py | laithsakka/torcharrow | a61a332773db1f63fa37b95038b63c316cd21781 | [
"BSD-3-Clause"
] | null | null | null | torcharrow/velox_rt/numerical_column_cpu.py | laithsakka/torcharrow | a61a332773db1f63fa37b95038b63c316cd21781 | [
"BSD-3-Clause"
] | null | null | null | torcharrow/velox_rt/numerical_column_cpu.py | laithsakka/torcharrow | a61a332773db1f63fa37b95038b63c316cd21781 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
import array as ar
import math
import operator
import statistics
from typing import Dict, List, Optional, Union, Callable
import numpy as np
import torcharrow as ta
import torcharrow._torcharrow as velox
import torcharrow.dtypes as dt
import torcharrow.pytorch as pyto... | 34.149733 | 118 | 0.570529 |
04a88b8d60cea1fe655dda1081a931671178a3d5 | 406 | py | Python | backend/app/core/migrations/0008_auto_20190209_1619.py | adithyanps/djangoAuthorization | 3a1df57574eb2a5aa7bd32d49d551b5d9e8f878c | [
"MIT"
] | null | null | null | backend/app/core/migrations/0008_auto_20190209_1619.py | adithyanps/djangoAuthorization | 3a1df57574eb2a5aa7bd32d49d551b5d9e8f878c | [
"MIT"
] | null | null | null | backend/app/core/migrations/0008_auto_20190209_1619.py | adithyanps/djangoAuthorization | 3a1df57574eb2a5aa7bd32d49d551b5d9e8f878c | [
"MIT"
] | null | null | null | # Generated by Django 2.1.5 on 2019-02-09 16:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20190209_1617'),
]
operations = [
migrations.AlterField(
model_name='employee',
name='salary',
... | 21.368421 | 71 | 0.610837 |
a76f40db4c1bb9f94ddc081e8304d6be52c0cab2 | 4,017 | py | Python | lib/gensim/topic_coherence/probability_estimation.py | duyetdev/api.duyetdev.com | 4c33cc2cfb43ad6c4089873230e7b657659bff15 | [
"MIT"
] | 4 | 2018-11-27T01:35:30.000Z | 2022-01-27T01:17:11.000Z | lib/gensim/topic_coherence/probability_estimation.py | duyetdev/api.duyetdev.com | 4c33cc2cfb43ad6c4089873230e7b657659bff15 | [
"MIT"
] | 12 | 2020-07-11T01:42:51.000Z | 2020-08-12T17:17:35.000Z | lib/gensim/topic_coherence/probability_estimation.py | duyetdev/api.duyetdev.com | 4c33cc2cfb43ad6c4089873230e7b657659bff15 | [
"MIT"
] | 1 | 2018-11-27T01:35:33.000Z | 2018-11-27T01:35:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module contains functions to perform segmentation on a list of topics.
"""
import logging
import numpy as np
from gensim.corp... | 38.625 | 124 | 0.686831 |
af334dd98c4b1b5adcb5008da59ee4176dfe973f | 1,971 | py | Python | jdcloud_sdk/services/vpc/apis/DescribeNetworkInterfacesRequest.py | jdcloud-demo/jdcloud-sdk-python | fddc2af24031c597948b8b8091978ac7e01a2695 | [
"Apache-2.0"
] | null | null | null | jdcloud_sdk/services/vpc/apis/DescribeNetworkInterfacesRequest.py | jdcloud-demo/jdcloud-sdk-python | fddc2af24031c597948b8b8091978ac7e01a2695 | [
"Apache-2.0"
] | null | null | null | jdcloud_sdk/services/vpc/apis/DescribeNetworkInterfacesRequest.py | jdcloud-demo/jdcloud-sdk-python | fddc2af24031c597948b8b8091978ac7e01a2695 | [
"Apache-2.0"
] | null | null | null | # 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 ... | 28.985294 | 77 | 0.679351 |
fbb7d0dc14499100015d134c72b98b9092279dfa | 10,866 | py | Python | google/cloud/firestore_admin_v1/services/firestore_admin/pagers.py | Arushi201296/python-firestore | 784e8ae27d42d8e25deacaf37c34d79369738b00 | [
"Apache-2.0"
] | null | null | null | google/cloud/firestore_admin_v1/services/firestore_admin/pagers.py | Arushi201296/python-firestore | 784e8ae27d42d8e25deacaf37c34d79369738b00 | [
"Apache-2.0"
] | null | null | null | google/cloud/firestore_admin_v1/services/firestore_admin/pagers.py | Arushi201296/python-firestore | 784e8ae27d42d8e25deacaf37c34d79369738b00 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.993007 | 87 | 0.672281 |
8f4367109521fea03dde1b04c27e9da67120d027 | 4,390 | py | Python | tests/interactive/media/test_player.py | whitestone8214/pyglet-1.3.0-mod | 4c07cdab21b2f87d65c1cc09057acfb5f8dcb392 | [
"BSD-3-Clause"
] | null | null | null | tests/interactive/media/test_player.py | whitestone8214/pyglet-1.3.0-mod | 4c07cdab21b2f87d65c1cc09057acfb5f8dcb392 | [
"BSD-3-Clause"
] | null | null | null | tests/interactive/media/test_player.py | whitestone8214/pyglet-1.3.0-mod | 4c07cdab21b2f87d65c1cc09057acfb5f8dcb392 | [
"BSD-3-Clause"
] | null | null | null | """
Interactively test the Player in pyglet.media for playing back sounds.
"""
import pytest
from time import sleep
import pyglet
#pyglet.options['debug_media'] = True
from pyglet.media.player import Player
from pyglet.media.sources import procedural
from pyglet.media.sources.base import StaticSource
@pytest.mark.re... | 33.257576 | 93 | 0.728702 |
fc2a25fe3244fd58f1e36709272838e7f2526624 | 4,049 | py | Python | src/olympia/search/indexers.py | Osmose/olympia | 774c3b927ec05ef971e4206e2669b4291b8b4f17 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/search/indexers.py | Osmose/olympia | 774c3b927ec05ef971e4206e2669b4291b8b4f17 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/search/indexers.py | Osmose/olympia | 774c3b927ec05ef971e4206e2669b4291b8b4f17 | [
"BSD-3-Clause"
] | null | null | null | import olympia.core.logger
from olympia.amo.indexers import BaseSearchIndexer
from olympia.addons.cron import reindex_addons
from olympia.addons.indexers import AddonIndexer
from olympia.bandwagon.cron import reindex_collections
from olympia.bandwagon.indexers import CollectionIndexer
from olympia.compat.cron import co... | 37.490741 | 78 | 0.575945 |
4e61dcd6743d0067db0b67f52321f6b439a766a1 | 1,638 | py | Python | opencv/sources/samples/python/houghlines.py | vrushank-agrawal/opencv-x64-cmake | 3f9486510d706c8ac579ac82f5d58f667f948124 | [
"Apache-2.0"
] | null | null | null | opencv/sources/samples/python/houghlines.py | vrushank-agrawal/opencv-x64-cmake | 3f9486510d706c8ac579ac82f5d58f667f948124 | [
"Apache-2.0"
] | null | null | null | opencv/sources/samples/python/houghlines.py | vrushank-agrawal/opencv-x64-cmake | 3f9486510d706c8ac579ac82f5d58f667f948124 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
'''
This example illustrates how to use Hough Transform to find lines
Usage:
houghlines.py [<image_name>]
image argument defaults to pic1.png
'''
# Python 2/3 compatibility
from __future__ import print_function
import cv2 as cv
import numpy as np
import sys
import math
... | 26.852459 | 122 | 0.517705 |
cb0030639b2ea68716d3853b51ee3ddf53deef24 | 2,878 | py | Python | tools/telemetry/telemetry/core/repeat_options.py | nagineni/chromium-crosswalk | 5725642f1c67d0f97e8613ec1c3e8107ab53fdf8 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | tools/telemetry/telemetry/core/repeat_options.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2017-02-14T21:55:58.000Z | 2017-02-14T21:55:58.000Z | tools/telemetry/telemetry/core/repeat_options.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import re
class RepeatOptions(object):
def __init__(self, page_repeat_secs=None, pageset_repeat_secs=None,
page_repeat_ite... | 47.966667 | 79 | 0.632384 |
fd525ca0b1d28cda76db65e7bdc3e4cb3beef8a1 | 122,726 | py | Python | qa/L0_lifecycle/lifecycle_test.py | NVIDIA/tensorrt-inference-server | cdfaf4f42830c648333b02f2e9597f4177dbe86d | [
"BSD-3-Clause"
] | 1,050 | 2018-11-21T03:32:15.000Z | 2020-03-19T10:16:04.000Z | qa/L0_lifecycle/lifecycle_test.py | NVIDIA/tensorrt-inference-server | cdfaf4f42830c648333b02f2e9597f4177dbe86d | [
"BSD-3-Clause"
] | 498 | 2018-11-26T10:42:10.000Z | 2020-03-19T20:56:13.000Z | qa/L0_lifecycle/lifecycle_test.py | NVIDIA/tensorrt-inference-server | cdfaf4f42830c648333b02f2e9597f4177dbe86d | [
"BSD-3-Clause"
] | 235 | 2018-11-22T16:37:34.000Z | 2020-03-19T06:33:18.000Z | # Copyright 2018-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list o... | 47.311488 | 142 | 0.528592 |
aff644651562b4355e2b9771771ecb6aaedab84d | 862 | py | Python | techreview/urls.py | lcared/TechReview2021 | 96b5f9af3c35f2f1dc79e6c53b48623d84e21da8 | [
"MIT"
] | 1 | 2021-06-14T17:39:37.000Z | 2021-06-14T17:39:37.000Z | techreview/urls.py | mjelde/TechReview2021 | 96b5f9af3c35f2f1dc79e6c53b48623d84e21da8 | [
"MIT"
] | null | null | null | techreview/urls.py | mjelde/TechReview2021 | 96b5f9af3c35f2f1dc79e6c53b48623d84e21da8 | [
"MIT"
] | null | null | null | """techreview 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-ba... | 35.916667 | 77 | 0.700696 |
80e36d49ce3b339b43ea98d87b7cb44367390710 | 10,955 | py | Python | utilities/Gnip-Trend-Detection/gnip_trend_detection/models.py | compston/TAP-Workshop | 84a7987081f71d45e057b30cc8e0cbc1b6af90d7 | [
"MIT"
] | null | null | null | utilities/Gnip-Trend-Detection/gnip_trend_detection/models.py | compston/TAP-Workshop | 84a7987081f71d45e057b30cc8e0cbc1b6af90d7 | [
"MIT"
] | null | null | null | utilities/Gnip-Trend-Detection/gnip_trend_detection/models.py | compston/TAP-Workshop | 84a7987081f71d45e057b30cc8e0cbc1b6af90d7 | [
"MIT"
] | null | null | null | import collections
import sys
import pickle
import math
import logging
import numpy as np
import scipy.stats.distributions as dists
from sklearn.linear_model import LinearRegression
"""
Classes in the module implement trend detection techniques.
For uniform interface, all classes must implement the following function... | 35.33871 | 140 | 0.612141 |
7a5d156502cd964ae40454de0f6c4db57306254c | 2,450 | py | Python | Lib/blackrenderer/backends/base.py | ctrlcctrlv/black-renderer | 39f1d1f91e1ea3d68ee09f0ab1d5bebb94b760da | [
"Apache-2.0"
] | 21 | 2021-04-29T09:04:59.000Z | 2022-02-09T22:18:21.000Z | Lib/blackrenderer/backends/base.py | ctrlcctrlv/black-renderer | 39f1d1f91e1ea3d68ee09f0ab1d5bebb94b760da | [
"Apache-2.0"
] | 47 | 2021-04-28T12:32:10.000Z | 2022-03-29T18:06:12.000Z | Lib/blackrenderer/backends/base.py | ctrlcctrlv/black-renderer | 39f1d1f91e1ea3d68ee09f0ab1d5bebb94b760da | [
"Apache-2.0"
] | 1 | 2022-02-09T12:32:13.000Z | 2022-02-09T12:32:13.000Z | from abc import ABC, abstractmethod
from contextlib import contextmanager
class Canvas(ABC):
@abstractmethod
def newPath(self):
...
@abstractmethod
@contextmanager
def savedState(self):
...
@abstractmethod
@contextmanager
def compositeMode(self, compositeMode):
... | 21.491228 | 74 | 0.574286 |
b8ffd1ad22d278b7c9f5184ba00eedf8ac6cb10f | 2,901 | py | Python | lightningdata/vision/VisionDataModule.py | brandongk-ubco/lightning-data | b6282aae45dcfc7da0c484d733be2e6c1af2ead8 | [
"MIT"
] | null | null | null | lightningdata/vision/VisionDataModule.py | brandongk-ubco/lightning-data | b6282aae45dcfc7da0c484d733be2e6c1af2ead8 | [
"MIT"
] | null | null | null | lightningdata/vision/VisionDataModule.py | brandongk-ubco/lightning-data | b6282aae45dcfc7da0c484d733be2e6c1af2ead8 | [
"MIT"
] | null | null | null | from pytorch_lightning.core.datamodule import LightningDataModule
import os
from torch.utils.data import DataLoader
import albumentations as A
class VisionDataModule(LightningDataModule):
def __init__(self,
name: str = None,
num_workers: int = int(os.environ.get("NUM_WORKERS", 0... | 37.675325 | 97 | 0.528438 |
f3c28ca5702465c933edc08892100f78c8d4ead1 | 4,563 | py | Python | sem1/lab1_3/iterative.py | NetherQuartz/NumericalMethodsLabs | 731ba11bc068018371d5e1a2f9b521ec7c4619ad | [
"MIT"
] | 1 | 2021-04-10T18:10:48.000Z | 2021-04-10T18:10:48.000Z | sem1/lab1_3/iterative.py | NetherQuartz/NumericalMethodsLabs | 731ba11bc068018371d5e1a2f9b521ec7c4619ad | [
"MIT"
] | null | null | null | sem1/lab1_3/iterative.py | NetherQuartz/NumericalMethodsLabs | 731ba11bc068018371d5e1a2f9b521ec7c4619ad | [
"MIT"
] | null | null | null | """ЛР 1.3, Ларькин Владимир, М8О-303Б-18"""
import numpy as np
import fire # CLI
import matplotlib.pyplot as plt
from utilities import parse_matrix # парсинг матрицы из файла
from sem1.lab1_1.gauss import lu_det, lu_decomposition
def diag_dominance(a: np.ndarray) -> bool:
"""Проверка матрицы на диагональное п... | 27.823171 | 97 | 0.593469 |
c85f3311307241f823724b35e2b66b2e75374165 | 3,093 | py | Python | examples/test_simple_alu.py | standanley/fault | 7418103744e3ec5b5d142e0a152f08b7feef6a1e | [
"BSD-3-Clause"
] | null | null | null | examples/test_simple_alu.py | standanley/fault | 7418103744e3ec5b5d142e0a152f08b7feef6a1e | [
"BSD-3-Clause"
] | null | null | null | examples/test_simple_alu.py | standanley/fault | 7418103744e3ec5b5d142e0a152f08b7feef6a1e | [
"BSD-3-Clause"
] | null | null | null | import magma as m
import mantle
import operator
import fault
import pytest
from hwtypes import BitVector
import os
class ConfigReg(m.Circuit):
IO = ["D", m.In(m.Bits[2]), "Q", m.Out(m.Bits[2])] + \
m.ClockInterface(has_ce=True)
@classmethod
def definition(io):
reg = mantle.Register(2, has... | 32.904255 | 80 | 0.614614 |
56393babe8b2e93fb460e8412a2de2663a71c19e | 4,068 | py | Python | tadpole_algorithms/evaluation/MAUC.py | anlijuncn/tadpole-algorithms | fe39e01f47fccbfe6c5310a0234a08b4c0a9061e | [
"Apache-2.0"
] | 4 | 2020-07-24T01:38:25.000Z | 2021-11-09T02:58:23.000Z | tadpole_algorithms/evaluation/MAUC.py | anlijuncn/tadpole-algorithms | fe39e01f47fccbfe6c5310a0234a08b4c0a9061e | [
"Apache-2.0"
] | 12 | 2020-02-25T19:13:22.000Z | 2022-03-12T00:43:20.000Z | tadpole_algorithms/evaluation/MAUC.py | anlijuncn/tadpole-algorithms | fe39e01f47fccbfe6c5310a0234a08b4c0a9061e | [
"Apache-2.0"
] | 10 | 2020-02-18T05:25:13.000Z | 2021-08-16T01:04:07.000Z | import itertools
"""
MAUCpy
~~~~~~
Contains two equations from Hand and Till's 2001 paper on a multi-class
approach to the AUC. The a_value() function is the probabilistic approximation
of the AUC found in equation 3, while MAUC() is the pairwise averaging of this
value for each of the classes.... | 43.276596 | 89 | 0.621681 |
2ae64db1be4dca9502b7f538765a0f25da069bd7 | 33,553 | py | Python | evalml/model_understanding/prediction_explanations/_user_interface.py | freddyaboulton/evalml | 53242f9d7397a1af3f8c48d498a023042790d4c3 | [
"BSD-3-Clause"
] | 454 | 2020-09-25T15:36:06.000Z | 2022-03-30T04:48:49.000Z | evalml/model_understanding/prediction_explanations/_user_interface.py | freddyaboulton/evalml | 53242f9d7397a1af3f8c48d498a023042790d4c3 | [
"BSD-3-Clause"
] | 2,175 | 2020-09-25T17:05:45.000Z | 2022-03-31T19:54:54.000Z | evalml/model_understanding/prediction_explanations/_user_interface.py | freddyaboulton/evalml | 53242f9d7397a1af3f8c48d498a023042790d4c3 | [
"BSD-3-Clause"
] | 66 | 2020-09-25T18:46:27.000Z | 2022-03-02T18:33:30.000Z | import abc
import pandas as pd
from texttable import Texttable
from evalml.model_understanding.prediction_explanations._algorithms import (
_aggregate_shap_values,
_compute_shap_values,
_normalize_shap_values,
)
from evalml.problem_types import ProblemTypes
def _make_rows(
shap_values,
normalize... | 37.198448 | 301 | 0.636813 |
88069d90d32e8fbd9c4ad0ff7e1995f2e63f4fa3 | 11,476 | py | Python | tests/integration/chat/v1/service/test_channel.py | ethan-schaffer/MassMessenger | 3042ed98864d012a7276a6a365f81690431d5157 | [
"MIT"
] | 2 | 2018-12-09T22:59:11.000Z | 2018-12-09T22:59:15.000Z | tests/integration/chat/v1/service/test_channel.py | kkrlee/twilio-python | 260de9df17c5a1440d9c037a971e2182da7f4ced | [
"MIT"
] | null | null | null | tests/integration/chat/v1/service/test_channel.py | kkrlee/twilio-python | 260de9df17c5a1440d9c037a971e2182da7f4ced | [
"MIT"
] | 1 | 2022-01-17T06:42:30.000Z | 2022-01-17T06:42:30.000Z | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class ChannelTestCase(Integratio... | 44.828125 | 166 | 0.570669 |
42e176f41c84135aeba0c4cbd069f4876c4fa88f | 9,418 | py | Python | experiments/delaney/train.py | pfnet-research/bayesgrad | 5db613391777b20b7a367c274804f0b736991b0a | [
"MIT"
] | 57 | 2018-06-30T01:47:19.000Z | 2022-03-03T17:21:42.000Z | experiments/delaney/train.py | pfnet-research/bayesgrad | 5db613391777b20b7a367c274804f0b736991b0a | [
"MIT"
] | null | null | null | experiments/delaney/train.py | pfnet-research/bayesgrad | 5db613391777b20b7a367c274804f0b736991b0a | [
"MIT"
] | 8 | 2018-07-07T06:18:40.000Z | 2021-02-23T21:58:45.000Z | from __future__ import print_function
import argparse
import os
import sys
import numpy as np
from sklearn.preprocessing import StandardScaler
import matplotlib as mpl
mpl.use('Agg')
from chainer import functions as F, cuda, Variable
from chainer import iterators as I
from chainer import optimizers as O
from chainer... | 38.129555 | 109 | 0.681036 |
12b130f0f03a19b151ed03b69158fad8c178644e | 1,229 | py | Python | examples/ganymede/ReconnectionRate/Interpolate_On_Boundary_batch.py | henry2004y/VisAnaJulia | cbf608847f66321f3fa8665f12a8850f7bd01408 | [
"MIT"
] | 7 | 2019-07-29T18:10:00.000Z | 2021-09-26T07:29:39.000Z | examples/ganymede/ReconnectionRate/Interpolate_On_Boundary_batch.py | henry2004y/VisAnaJulia | cbf608847f66321f3fa8665f12a8850f7bd01408 | [
"MIT"
] | 9 | 2020-10-07T16:08:33.000Z | 2021-11-08T20:18:32.000Z | examples/ganymede/ReconnectionRate/Interpolate_On_Boundary_batch.py | henry2004y/VisAnaJulia | cbf608847f66321f3fa8665f12a8850f7bd01408 | [
"MIT"
] | 1 | 2021-01-04T10:31:52.000Z | 2021-01-04T10:31:52.000Z | # Batch processing script.
# By default ParaView uses nearest neighbor interpolation.
#
# Hongyang Zhou, hyzhou@umich.edu 11/18/2019
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a n... | 32.342105 | 67 | 0.766477 |
7ec0efd5b0d8260e009e677cd4c6bdd1980ca69a | 66,842 | py | Python | src/v5.1/resources/swagger_client/models/__init__.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 2 | 2021-04-27T17:18:17.000Z | 2021-04-27T19:14:39.000Z | src/v5.1/resources/swagger_client/models/__init__.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | null | null | null | src/v5.1/resources/swagger_client/models/__init__.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 1 | 2022-01-06T09:43:11.000Z | 2022-01-06T09:43:11.000Z | # coding: utf-8
# flake8: noqa
"""
Ed-Fi Operational Data Store API
The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface. *** > *Note: Consumers of ODS / API information should sanitize all data for display and storage. The ODS / AP... | 104.604069 | 482 | 0.941459 |
af83333cbd002861c3b1ea7c802e466c201bf6dc | 1,101 | py | Python | release/stubs.min/System/__init___parts/DataMisalignedException.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/__init___parts/DataMisalignedException.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/__init___parts/DataMisalignedException.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class DataMisalignedException(SystemException):
"""
The exception that is thrown when a unit of data is read from or written to an address that is not a multiple of the data size. This class cannot be inherited.
DataMisalignedException()
DataMisalignedException(message: str)
DataMisalignedException(mes... | 35.516129 | 215 | 0.724796 |
830e54f7218f8e497fa7a8ae92efc7686a1e503c | 108 | py | Python | linkcheck/urls.py | AASHE/django-linkcheck | 268a30d2bed9789d4c19ce62e6e55f749503f5f9 | [
"BSD-3-Clause"
] | null | null | null | linkcheck/urls.py | AASHE/django-linkcheck | 268a30d2bed9789d4c19ce62e6e55f749503f5f9 | [
"BSD-3-Clause"
] | null | null | null | linkcheck/urls.py | AASHE/django-linkcheck | 268a30d2bed9789d4c19ce62e6e55f749503f5f9 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls.defaults import *
urlpatterns = patterns('linkcheck.views',
(r'^.*$', 'report'),
) | 21.6 | 41 | 0.666667 |
e4cc6fafb150a6c9527c3a14f8a393ffd907ec6c | 1,901 | py | Python | dataloader.py | MiniEval/pytorch-gken | c8fd44daba781057c3f94c86f64d98430d962d9c | [
"MIT"
] | 4 | 2021-07-19T20:53:05.000Z | 2022-03-08T09:31:36.000Z | dataloader.py | MiniEval/pytorch-gken | c8fd44daba781057c3f94c86f64d98430d962d9c | [
"MIT"
] | 1 | 2022-03-08T08:47:09.000Z | 2022-03-08T09:31:30.000Z | dataloader.py | MiniEval/pytorch-gken | c8fd44daba781057c3f94c86f64d98430d962d9c | [
"MIT"
] | 3 | 2021-12-30T16:37:52.000Z | 2022-03-08T09:37:16.000Z | import random
import numpy as np
from pathlib import Path
import sys
class DataLoader:
def __init__(self):
train_data_paths = list(Path("./train_data/").rglob("*.npy"))
test_data_paths = list(Path("./test_data/").rglob("*.npy"))
if len(train_data_paths) == 0:
print("Training d... | 32.775862 | 114 | 0.583903 |
f4ca073ddefbdd422e895ae45d46ad85e81543aa | 2,921 | py | Python | datahub/omis/invoice/test/test_managers.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 6 | 2019-12-02T16:11:24.000Z | 2022-03-18T10:02:02.000Z | datahub/omis/invoice/test/test_managers.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 1,696 | 2019-10-31T14:08:37.000Z | 2022-03-29T12:35:57.000Z | datahub/omis/invoice/test/test_managers.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 9 | 2019-11-22T12:42:03.000Z | 2021-09-03T14:25:05.000Z | from unittest import mock
import pytest
from dateutil.parser import parse as dateutil_parse
from datahub.omis.invoice import constants
from datahub.omis.invoice.models import Invoice
from datahub.omis.order.test.factories import OrderFactory
# mark the whole module for db use
pytestmark = pytest.mark.django_db
cl... | 47.112903 | 90 | 0.759329 |
cf916b4ad4c45a9d59394159fa743f5b0b76b511 | 2,532 | py | Python | recognition/common/rec2shufrec.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | 12,377 | 2017-12-04T02:46:57.000Z | 2022-03-31T16:48:31.000Z | recognition/common/rec2shufrec.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | 1,851 | 2017-12-05T05:41:23.000Z | 2022-03-30T13:06:22.000Z | recognition/common/rec2shufrec.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | 4,198 | 2017-12-05T02:57:19.000Z | 2022-03-30T10:29:37.000Z | import os
import os.path as osp
import sys
import datetime
import glob
import shutil
import numbers
import mxnet as mx
from mxnet import ndarray as nd
from mxnet import io
from mxnet import recordio
import random
import argparse
import cv2
import time
import numpy as np
def main(args):
ds = args.input
path_img... | 34.684932 | 116 | 0.631517 |
e8fc86af7259c235d1ae02e71c1c8e116db2e28f | 6,429 | py | Python | airflow/security/kerberos.py | tanelk/airflow | 6c9a7999ef04ec6805f5dda4977a08ade0fc115c | [
"Apache-2.0"
] | 1 | 2020-01-03T12:13:27.000Z | 2020-01-03T12:13:27.000Z | airflow/security/kerberos.py | tanelk/airflow | 6c9a7999ef04ec6805f5dda4977a08ade0fc115c | [
"Apache-2.0"
] | 3 | 2021-12-17T19:19:13.000Z | 2022-02-28T01:29:32.000Z | airflow/security/kerberos.py | tanelk/airflow | 6c9a7999ef04ec6805f5dda4977a08ade0fc115c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | 34.015873 | 109 | 0.654379 |
b3d9fae045ce1b30f809c41ad8fe621928aa64c4 | 2,348 | py | Python | monitor_http_log/tests/test_main.py | JordanP/monitor-http-log | 3565e51904adb9c3c9ddaec611a6ed515194f9e8 | [
"Apache-2.0"
] | null | null | null | monitor_http_log/tests/test_main.py | JordanP/monitor-http-log | 3565e51904adb9c3c9ddaec611a6ed515194f9e8 | [
"Apache-2.0"
] | null | null | null | monitor_http_log/tests/test_main.py | JordanP/monitor-http-log | 3565e51904adb9c3c9ddaec611a6ed515194f9e8 | [
"Apache-2.0"
] | null | null | null | import time
import unittest
from monitor_http_log.main import ALARM_STATE_HIGH
from monitor_http_log.main import ALARM_STATE_LOW
from monitor_http_log.main import evaluate_alarm
class TestMain(unittest.TestCase):
def setUp(self):
self.now = time.time()
def test_evaluate_alarm_with_no_data(self):
... | 36.123077 | 77 | 0.671635 |
b5fa23b29b7909cc73a3b0f57efbded1f28a0a74 | 16,420 | py | Python | SVHN/test_calibration.py | ngduyanhece/outlier-exposure | b959d62acddabef570068b2ce2752c0f80150ae1 | [
"Apache-2.0"
] | 442 | 2018-06-06T02:51:47.000Z | 2022-03-28T12:37:58.000Z | SVHN/test_calibration.py | ngduyanhece/outlier-exposure | b959d62acddabef570068b2ce2752c0f80150ae1 | [
"Apache-2.0"
] | 21 | 2019-01-08T19:09:18.000Z | 2022-02-21T15:19:39.000Z | SVHN/test_calibration.py | ngduyanhece/outlier-exposure | b959d62acddabef570068b2ce2752c0f80150ae1 | [
"Apache-2.0"
] | 108 | 2018-11-14T06:17:39.000Z | 2022-03-06T05:16:25.000Z | import numpy as np
import sys
import os
import pickle
import argparse
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torchvision.transforms as trn
import torchvision.datasets as dset
import torch.nn.functional as F
from models.allconv import AllConvNet
from models.wrn import WideResNet
f... | 38.186047 | 118 | 0.664799 |
473a5cac78e8b1c9e8a6fc157a1243f92c79c65c | 1,326 | py | Python | tests/tests/correctness/EPLAnalytics/GeoLocation/Speed/Speed_cor_007/run.py | rpeach-sag/apama-industry-analytics-kit | a3f6039915501d41251b6f7ec41b0cb8111baf7b | [
"Apache-2.0"
] | 3 | 2019-09-02T18:21:22.000Z | 2020-04-17T16:34:57.000Z | tests/tests/correctness/EPLAnalytics/GeoLocation/Speed/Speed_cor_007/run.py | rpeach-sag/apama-industry-analytics-kit | a3f6039915501d41251b6f7ec41b0cb8111baf7b | [
"Apache-2.0"
] | null | null | null | tests/tests/correctness/EPLAnalytics/GeoLocation/Speed/Speed_cor_007/run.py | rpeach-sag/apama-industry-analytics-kit | a3f6039915501d41251b6f7ec41b0cb8111baf7b | [
"Apache-2.0"
] | null | null | null | # $Copyright (c) 2015 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel an... | 45.724138 | 343 | 0.718703 |
386285d69017a4e74892293ff62d6f069272b944 | 3,345 | py | Python | optipyzer/db/interfaces.py | nleroy917/optipyzer | 2a499e2759841fa01b0dc078bf7b17cc4335c566 | [
"Apache-2.0"
] | 3 | 2022-02-19T03:15:15.000Z | 2022-03-20T03:41:39.000Z | optipyzer/db/interfaces.py | nleroy917/optipyzer | 2a499e2759841fa01b0dc078bf7b17cc4335c566 | [
"Apache-2.0"
] | 13 | 2021-12-09T06:56:27.000Z | 2022-03-31T03:28:30.000Z | optipyzer/db/interfaces.py | nleroy917/optipyzer | 2a499e2759841fa01b0dc078bf7b17cc4335c566 | [
"Apache-2.0"
] | 1 | 2022-02-28T05:52:38.000Z | 2022-02-28T05:52:38.000Z | from .database import SessionLocal
from .models import Organism, AutocompleteOrganism, CodonUsage
from ..const import AA_CODON_LIBRARY
# not used unless the database connection
# is required at the endpoint level
def _get_db():
"""Fetch database session"""
db = SessionLocal()
try:
yield db
fina... | 34.132653 | 100 | 0.669357 |
c881157f6690e939d3466b3f428f1379bbc39400 | 26,090 | py | Python | salt/cloud/clouds/libcloud_aws.py | johngrasty/salt | f66b18d8ee52eb988c3dbd8ba3ff6a6173c8aea5 | [
"Apache-2.0"
] | null | null | null | salt/cloud/clouds/libcloud_aws.py | johngrasty/salt | f66b18d8ee52eb988c3dbd8ba3ff6a6173c8aea5 | [
"Apache-2.0"
] | 1 | 2015-09-02T12:49:48.000Z | 2015-09-02T19:22:58.000Z | salt/cloud/clouds/libcloud_aws.py | johngrasty/salt | f66b18d8ee52eb988c3dbd8ba3ff6a6173c8aea5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
The AWS Cloud Module
====================
The AWS cloud module is used to interact with the Amazon Web Services system.
This module has been replaced by the EC2 cloud module, and is no longer
supported. The documentation shown here is for reference only; it is highly
recommended to change ... | 31.358173 | 117 | 0.603986 |
b005f719264e69a454da1a890855417b2f5831ae | 1,471 | py | Python | azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_summary.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_summary.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_summary.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 36.775 | 91 | 0.634942 |
0021a982d318d026add6d7bd6f892d3201a2add1 | 954 | py | Python | tests/test_geomutils.py | kokinomura/reportlab | 18e39b85d7277c2b5e9218b30a7b7b0a644a3c02 | [
"BSD-3-Clause"
] | 52 | 2016-09-30T05:53:45.000Z | 2021-12-26T12:07:48.000Z | tests/test_geomutils.py | kokinomura/reportlab | 18e39b85d7277c2b5e9218b30a7b7b0a644a3c02 | [
"BSD-3-Clause"
] | 2 | 2016-09-30T06:05:01.000Z | 2017-11-05T12:58:47.000Z | tests/test_geomutils.py | kokinomura/reportlab | 18e39b85d7277c2b5e9218b30a7b7b0a644a3c02 | [
"BSD-3-Clause"
] | 15 | 2016-11-03T08:50:15.000Z | 2022-01-14T07:04:35.000Z | #!/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2016
#see license.txt for license details
__version__='3.3.0'
__doc__="""Tests for geometry utility functions."""
import unittest
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses
setOutDir(__name__)
class GeomTestCase(unittest.TestCase):
de... | 28.909091 | 97 | 0.616352 |
f696456b09dcb6b484ff739d41e014d7f1073413 | 529 | py | Python | setup.py | raeoks/mpain | d6d3920a35f6d2d188106e32389ea365137d23c4 | [
"MIT"
] | null | null | null | setup.py | raeoks/mpain | d6d3920a35f6d2d188106e32389ea365137d23c4 | [
"MIT"
] | null | null | null | setup.py | raeoks/mpain | d6d3920a35f6d2d188106e32389ea365137d23c4 | [
"MIT"
] | null | null | null | from setuptools import setup
import mpain
setup(name=mpain.NAME,
version=mpain.VERSION,
description=mpain.DESCRIPTION,
url='http://github.com/raeoks/mpain',
author='Ranjeet Singh',
author_email='ranjeet@raeoks.com',
license='MIT',
packages=['mpain'],
install_requires=[],... | 25.190476 | 43 | 0.595463 |
a2da9eb4e4413dc9d71290e966ca8c718e0d1477 | 1,941 | py | Python | gallerys/views.py | joseck12/josecksgallery | 3c37c32d1b1538e8f71800f2fe778c7a982b9635 | [
"Unlicense"
] | null | null | null | gallerys/views.py | joseck12/josecksgallery | 3c37c32d1b1538e8f71800f2fe778c7a982b9635 | [
"Unlicense"
] | null | null | null | gallerys/views.py | joseck12/josecksgallery | 3c37c32d1b1538e8f71800f2fe778c7a982b9635 | [
"Unlicense"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
import datetime as dt
from django.http import Http404
from django.shortcuts import render,redirect
from .models import Image,Category,Location
# Create your views here.
def welcome(request):
return render(request, 'welcome.html')
def gallery... | 32.35 | 104 | 0.705822 |
d3e2ce3f15248d4cdc61901a763eb43afbe9b2e3 | 3,456 | py | Python | infrastructure/app_controller.py | nazarii-piontko/ToDo-BDD | 5418e712609c686e3a0220889c694f05560e2f31 | [
"MIT"
] | 1 | 2021-01-17T15:28:50.000Z | 2021-01-17T15:28:50.000Z | infrastructure/app_controller.py | nazarii-piontko/node-todo-bdd | 5418e712609c686e3a0220889c694f05560e2f31 | [
"MIT"
] | null | null | null | infrastructure/app_controller.py | nazarii-piontko/node-todo-bdd | 5418e712609c686e3a0220889c694f05560e2f31 | [
"MIT"
] | 1 | 2022-02-07T21:44:54.000Z | 2022-02-07T21:44:54.000Z | from typing import NoReturn, Union
from logging import Logger
from subprocess import Popen
from infrastructure.utils import is_uri_accessible, execute_with_retry
from infrastructure.errors import TestError
from infrastructure.config import Config
from infrastructure.config_keys import WellKnownConfigKeys
class AppCo... | 35.628866 | 97 | 0.664931 |
8a4956b699718ad1dc8f0a4329e581432f5be7a1 | 59,572 | py | Python | tests/config_parsing.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | null | null | null | tests/config_parsing.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | null | null | null | tests/config_parsing.py | fossabot/DIRBS-Core-1 | 70bf72e2e6dda6e0d7a20cf744300930d88ee70c | [
"PostgreSQL",
"Unlicense"
] | 3 | 2019-10-24T11:40:06.000Z | 2022-02-24T07:34:00.000Z | """
Config parsing unit tests.
Copyright (c) 2018-2019 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the following conditions are met:
- Redistribution... | 52.302019 | 120 | 0.613476 |
5475b03686d83496b6e668bcd24b923bb0c2a6e5 | 317 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/Overflow/Beginners-Python-Examples-master/systemInfo.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 5 | 2021-06-02T23:44:25.000Z | 2021-12-27T16:21:57.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/Overflow/Beginners-Python-Examples-master/systemInfo.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 22 | 2021-05-31T01:33:25.000Z | 2021-10-18T18:32:39.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/Overflow/Beginners-Python-Examples-master/systemInfo.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 3 | 2021-06-19T03:37:47.000Z | 2021-08-31T00:49:51.000Z | import platform
import os
import sys
print("============================")
print("System Information : ")
print(os.name)
print(platform.system())
print(platform.release(), "\n")
print("============================")
print("Python Version Installed : ")
print(sys.version, "\n")
print("============================")
| 22.642857 | 37 | 0.511041 |
e73acad91c2a8bbcc9563b9b9f67c4de54bdb15c | 4,032 | py | Python | ctapipe/tools/display_summed_images.py | pgrespan/ctapipe | 9eeaaebc741c48bba9e5a457587c4d5138f79320 | [
"BSD-3-Clause"
] | null | null | null | ctapipe/tools/display_summed_images.py | pgrespan/ctapipe | 9eeaaebc741c48bba9e5a457587c4d5138f79320 | [
"BSD-3-Clause"
] | null | null | null | ctapipe/tools/display_summed_images.py | pgrespan/ctapipe | 9eeaaebc741c48bba9e5a457587c4d5138f79320 | [
"BSD-3-Clause"
] | null | null | null | """
Select a group of similar telescopes (with same camera type), Loop over
events where telescopes in the group participate, sum the image from each
telescope, and display it.
"""
import numpy as np
from matplotlib import pyplot as plt
from ctapipe.calib import CameraCalibrator
from ctapipe.core import Tool
from cta... | 32.256 | 86 | 0.612103 |
9a9f001bda99903a4ce617c7889966197c506fd6 | 2,652 | py | Python | 02Statistics Essentials/02Inferential Statistics/03Continuous Probability Distributions/test.py | talk2sunil83/UpgradLearning | 70c4f993c68ce5030e9df0edd15004bbb9fc71e7 | [
"Apache-2.0"
] | null | null | null | 02Statistics Essentials/02Inferential Statistics/03Continuous Probability Distributions/test.py | talk2sunil83/UpgradLearning | 70c4f993c68ce5030e9df0edd15004bbb9fc71e7 | [
"Apache-2.0"
] | null | null | null | 02Statistics Essentials/02Inferential Statistics/03Continuous Probability Distributions/test.py | talk2sunil83/UpgradLearning | 70c4f993c68ce5030e9df0edd15004bbb9fc71e7 | [
"Apache-2.0"
] | null | null | null |
# %%
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from typing import Tuple
from numpy import sqrt, sin, cos, pi
from scipy.integrate.quadpack import quad, dblquad, nquad
from scipy import special, integrate
import numpy as np
import scipy.special as special
# %%
(95 - 68)/2
# %%
(99.7 - ... | 16.47205 | 139 | 0.637632 |
dc5ee9bb1a4614345dd4d69d005fb9a8d9226c7b | 3,267 | py | Python | api/app/resources/theq/csr_detail.py | dheepak-aot/queue-management-1 | a96e3ab4b8e4e14e2d70e940de6d9551f6f093be | [
"Apache-2.0"
] | 1 | 2020-04-27T20:31:06.000Z | 2020-04-27T20:31:06.000Z | api/app/resources/theq/csr_detail.py | dheepak-aot/queue-management-1 | a96e3ab4b8e4e14e2d70e940de6d9551f6f093be | [
"Apache-2.0"
] | null | null | null | api/app/resources/theq/csr_detail.py | dheepak-aot/queue-management-1 | a96e3ab4b8e4e14e2d70e940de6d9551f6f093be | [
"Apache-2.0"
] | null | null | null | '''Copyright 2018 Province of British Columbia
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,... | 38.892857 | 115 | 0.674625 |
526fd660efbb944d79dca8a80aebb81c3b3643c4 | 797 | py | Python | home/urls.py | Marcio-Souza/sistema-vendas | f7d5c2dde6ddc8bf6ea3261dd4857cc8ea7bb2f3 | [
"MIT"
] | null | null | null | home/urls.py | Marcio-Souza/sistema-vendas | f7d5c2dde6ddc8bf6ea3261dd4857cc8ea7bb2f3 | [
"MIT"
] | 6 | 2020-10-26T22:06:11.000Z | 2020-10-28T15:24:26.000Z | home/urls.py | Marcio-Souza/sistema-vendas | f7d5c2dde6ddc8bf6ea3261dd4857cc8ea7bb2f3 | [
"MIT"
] | null | null | null | """WebVendas 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-bas... | 34.652174 | 77 | 0.698871 |
cbc8b82a5e495cca3e70c857fcf48612d4aea06c | 620 | py | Python | qpost/viz/material.py | johnaparker/Qpost | 3fcbe79221687fc87dc17b1fd06239966ca9414d | [
"MIT"
] | null | null | null | qpost/viz/material.py | johnaparker/Qpost | 3fcbe79221687fc87dc17b1fd06239966ca9414d | [
"MIT"
] | null | null | null | qpost/viz/material.py | johnaparker/Qpost | 3fcbe79221687fc87dc17b1fd06239966ca9414d | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import qpost
def plot_materials(h5file):
materials = qpost.materials.load_all_materials(h5file)
f_min, f_max = qpost.monitors.get_freq_range(h5file)
freq = np.linspace(f_min, f_max, 1000)
for name,material in materials.items():
eps = material... | 28.181818 | 64 | 0.651613 |
d924afc4a7ac31c357561441c106e5c04f8cd0cf | 1,356 | py | Python | gnosis/boilerplate/supervised_epoch.py | samuelstanton/gnosis | 1b81adcbcd1566d7ea6dda1594f276d64950c998 | [
"MIT"
] | 13 | 2021-12-07T13:41:48.000Z | 2022-03-13T12:37:33.000Z | gnosis/boilerplate/supervised_epoch.py | samuelstanton/gnosis | 1b81adcbcd1566d7ea6dda1594f276d64950c998 | [
"MIT"
] | null | null | null | gnosis/boilerplate/supervised_epoch.py | samuelstanton/gnosis | 1b81adcbcd1566d7ea6dda1594f276d64950c998 | [
"MIT"
] | 1 | 2021-12-09T08:08:47.000Z | 2021-12-09T08:08:47.000Z | from tqdm import tqdm
from upcycle.cuda import try_cuda
def get_lr(lr_scheduler):
return lr_scheduler.get_last_lr()[0]
def supervised_epoch(net, loader, optimizer, lr_scheduler, epoch, loss_fn):
print('\nEpoch: %d' % epoch)
net.train()
train_loss = 0
correct = 0
total = 0
desc = ('[LR=%... | 30.818182 | 109 | 0.59292 |
0b04fe6b17056bb836a8671e0fc2aa967d1d5a1a | 561 | py | Python | server/djangoapp/admin.py | yxtao/agfzb-CloudAppDevelopment_Capstone | b75ba22adc3d49fb80f6a75074c5fcee6d44d574 | [
"Apache-2.0"
] | null | null | null | server/djangoapp/admin.py | yxtao/agfzb-CloudAppDevelopment_Capstone | b75ba22adc3d49fb80f6a75074c5fcee6d44d574 | [
"Apache-2.0"
] | null | null | null | server/djangoapp/admin.py | yxtao/agfzb-CloudAppDevelopment_Capstone | b75ba22adc3d49fb80f6a75074c5fcee6d44d574 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import CarMake, CarModel
# CarModelInline class
class CarModelInline(admin.StackedInline):
model = CarModel
extra = 3
# CarModelAdmin class
class CarModelAdmin(admin.ModelAdmin):
list_display = ['name', 'dealer_id', 'type', 'year']
# CarMakeAdmin class with... | 23.375 | 56 | 0.757576 |
4a705494c0bba200e628c821106d3bef8a104543 | 526 | py | Python | misc/sockatse.py | shreyas202/thonny | ef894c359200b0591cf98451907243395b817c63 | [
"MIT"
] | 1 | 2021-10-30T16:56:40.000Z | 2021-10-30T16:56:40.000Z | misc/sockatse.py | shreyas202/thonny | ef894c359200b0591cf98451907243395b817c63 | [
"MIT"
] | 13 | 2018-11-15T09:31:06.000Z | 2019-11-22T18:16:54.000Z | misc/sockatse.py | shreyas202/thonny | ef894c359200b0591cf98451907243395b817c63 | [
"MIT"
] | 3 | 2018-11-24T14:00:30.000Z | 2019-07-02T02:32:26.000Z | import socket
from time import sleep
port = 4957
def become_client():
s = socket.create_connection(("localhost", port), 0.1)
def become_server():
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversocket.bind(("localhost", port))
serversocket.listen(5)
while True:
(c... | 19.481481 | 68 | 0.690114 |
4fd2b55e5874c8835b83863c643b9ae8a1b5dc9c | 971 | py | Python | python/sdk/test/resource_request_test.py | karzuo/merlin | bdbdac35071d81beb1b8b5b807697bf2eac69a40 | [
"Apache-2.0"
] | 1 | 2021-12-26T09:04:12.000Z | 2021-12-26T09:04:12.000Z | python/sdk/test/resource_request_test.py | ibnummuhammad/merlin | acf10a350bcacfdfe67f7020d535467b71ff1d89 | [
"Apache-2.0"
] | null | null | null | python/sdk/test/resource_request_test.py | ibnummuhammad/merlin | acf10a350bcacfdfe67f7020d535467b71ff1d89 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Merlin 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 w... | 34.678571 | 92 | 0.761071 |
cad07a5cb6e053bad1fcf279230b9ac766a6c113 | 5,411 | py | Python | chainermn/functions/batch_normalization.py | dr4mohamed/chainer | 6fa28004889b260ae13484f17dc1ac68b25d52bb | [
"MIT"
] | 1 | 2019-09-04T15:15:43.000Z | 2019-09-04T15:15:43.000Z | chainermn/functions/batch_normalization.py | dr4mohamed/chainer | 6fa28004889b260ae13484f17dc1ac68b25d52bb | [
"MIT"
] | null | null | null | chainermn/functions/batch_normalization.py | dr4mohamed/chainer | 6fa28004889b260ae13484f17dc1ac68b25d52bb | [
"MIT"
] | null | null | null | import chainer
from chainer import cuda
import chainer.utils
from chainer.functions.normalization.batch_normalization \
import GeneralBatchNormalizationImpl
class _MpiImpl(GeneralBatchNormalizationImpl):
def __init__(self, comm):
self.comm = comm
def get_mean_and_var(self, axis, gamma, x, xp, int... | 41.945736 | 79 | 0.631861 |
49446e2ae0e4bc100fd4443c816d2c50f521792c | 2,954 | py | Python | string-notes.py | ampise/python | 6723861b5a359da9e0e042e7c24d8caa5e36999c | [
"Apache-2.0"
] | null | null | null | string-notes.py | ampise/python | 6723861b5a359da9e0e042e7c24d8caa5e36999c | [
"Apache-2.0"
] | null | null | null | string-notes.py | ampise/python | 6723861b5a359da9e0e042e7c24d8caa5e36999c | [
"Apache-2.0"
] | null | null | null | string1 = "Scout Finch"
string2 = "Harry Potter"
# Concatenation can be used to join multiple strings into one larger string
print(string1 + string2)
# We cannot subtract strings as it will give error and not work
# We can mutiply strings, but cannot divide strings
print(string1 * 3)
# Important String Commands
#... | 25.686957 | 127 | 0.726134 |
0c622d663d762eeec60623c77f67523193e5b488 | 503 | py | Python | parte 1/desafio30.py | BrunoSoares-DEV/Exercicios-python | fcfd0a7b3e2c6af2b7dd8e5a15ca6585c97f7c67 | [
"MIT"
] | 2 | 2021-02-24T20:05:24.000Z | 2021-02-24T20:05:41.000Z | parte 1/desafio30.py | BrunoSoares-DEV/Exercicios-python | fcfd0a7b3e2c6af2b7dd8e5a15ca6585c97f7c67 | [
"MIT"
] | null | null | null | parte 1/desafio30.py | BrunoSoares-DEV/Exercicios-python | fcfd0a7b3e2c6af2b7dd8e5a15ca6585c97f7c67 | [
"MIT"
] | null | null | null | #pegando valor
numUsu = int(input('Digite um número: '))
if numUsu % 2 == 0:
print('Seu número é {}, e ele é par'.format(numUsu))
else:
print('Seu número é {}, e ele é impar'.format(numUsu))
'''
Primeiro o usuário vai digitar um valor armazenado em numUsu
Na verificação, se o na divisão real do numUsu... | 33.533333 | 99 | 0.67992 |
88d4e09c9d301fa0dd4a79919320ff442773a721 | 4,101 | py | Python | staircase/core/arrays/transform.py | amagee/staircase | e0a45c05648e778ef61b624836908726fcc98b48 | [
"MIT"
] | 25 | 2020-09-05T01:26:43.000Z | 2021-01-31T06:51:47.000Z | staircase/core/arrays/transform.py | amagee/staircase | e0a45c05648e778ef61b624836908726fcc98b48 | [
"MIT"
] | 76 | 2020-03-03T22:26:19.000Z | 2021-07-09T09:29:38.000Z | staircase/core/arrays/transform.py | amagee/staircase | e0a45c05648e778ef61b624836908726fcc98b48 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from staircase.constants import inf
from staircase.core.arrays import docstrings
from staircase.core.stairs import Stairs
from staircase.core.stats.statistic import corr as _corr
from staircase.core.stats.statistic import cov as _cov
from staircase.util._decorators import Appende... | 41.424242 | 110 | 0.689588 |
ba5e9839f5f428f570c50cde94a7a1fbe31a5c60 | 2,810 | py | Python | Final Project/main.py | shoulderhu/azure-vision-ipy | 6689870ad599750d309c85c9b18d2856a06e05a4 | [
"MIT"
] | null | null | null | Final Project/main.py | shoulderhu/azure-vision-ipy | 6689870ad599750d309c85c9b18d2856a06e05a4 | [
"MIT"
] | null | null | null | Final Project/main.py | shoulderhu/azure-vision-ipy | 6689870ad599750d309c85c9b18d2856a06e05a4 | [
"MIT"
] | null | null | null | import cv2 as cv
import numpy as np
import sys
from skimage.measure import label, regionprops
from skimage.morphology import remove_small_objects
from skimage.segmentation import clear_border
from skimage.util import img_as_ubyte, img_as_bool
def main(imshow=False):
f = open("output/output.txt", "w+")
for n... | 28.969072 | 77 | 0.516014 |
01a6ab7f7456e182846d0b8bc5ead9be01105e46 | 8,216 | py | Python | sapp/tests/fake_object_generator.py | arpancodes/sapp | 709ffae4d4f35ffd9a85e2ff272df1b979aeb51b | [
"MIT"
] | null | null | null | sapp/tests/fake_object_generator.py | arpancodes/sapp | 709ffae4d4f35ffd9a85e2ff272df1b979aeb51b | [
"MIT"
] | null | null | null | sapp/tests/fake_object_generator.py | arpancodes/sapp | 709ffae4d4f35ffd9a85e2ff272df1b979aeb51b | [
"MIT"
] | null | null | null | #!/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.
# pyre-unsafe
import datetime
from typing import Optional
from ..bulk_saver import BulkSaver
from ..models import (
... | 32.346457 | 82 | 0.601874 |
e095e9de2a062755d0fe795ea1d725529c875a47 | 2,582 | py | Python | startrek-py/startrek/socket/active_conn.py | moky/WormHole | 6b2b79274274f6764e0d519d384eb65489f4ca56 | [
"MIT"
] | null | null | null | startrek-py/startrek/socket/active_conn.py | moky/WormHole | 6b2b79274274f6764e0d519d384eb65489f4ca56 | [
"MIT"
] | null | null | null | startrek-py/startrek/socket/active_conn.py | moky/WormHole | 6b2b79274274f6764e0d519d384eb65489f4ca56 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Star Trek: Interstellar Transport
#
# Written in 2021 by Moky <albert.moky@gmail.com>
#
# ==============================================================================
# MIT License
#
# Copyright (c) 2021 Albert Moky
#
# Permission is hereby granted, free of... | 38.537313 | 104 | 0.650271 |
aa973cb28c2de3dd8ad34eba1f47e27b64ed9b0a | 3,506 | py | Python | test/compute/test_cloudstack.py | ggreer/libcloud | a391ccdc0d068d37cb906a703f1494af50d83c8f | [
"Apache-2.0"
] | 1 | 2021-06-14T11:11:39.000Z | 2021-06-14T11:11:39.000Z | test/compute/test_cloudstack.py | ggreer/libcloud | a391ccdc0d068d37cb906a703f1494af50d83c8f | [
"Apache-2.0"
] | null | null | null | test/compute/test_cloudstack.py | ggreer/libcloud | a391ccdc0d068d37cb906a703f1494af50d83c8f | [
"Apache-2.0"
] | null | null | null | import sys
import unittest
from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import urlparse
try:
import simplejson as json
except ImportError:
import json
try:
parse_qsl = urlparse.parse_qsl
except AttributeError:
import cgi
parse_qsl = cgi.parse_qsl
from libcloud.compute.drivers.c... | 33.390476 | 73 | 0.617228 |
b26ea947766f434f4d0be9a567700b0058d9067c | 3,712 | py | Python | examples/onnx/vgg16.py | lijiansong/singa | 352cfc910deff0d6a8383c5e97f45795c67cb206 | [
"Apache-2.0"
] | 1 | 2020-04-28T01:42:33.000Z | 2020-04-28T01:42:33.000Z | examples/onnx/vgg16.py | yshuailiu/singa | 50d3092e8f489994becf84ee7e22c69a935a1f13 | [
"Apache-2.0"
] | null | null | null | examples/onnx/vgg16.py | yshuailiu/singa | 50d3092e8f489994becf84ee7e22c69a935a1f13 | [
"Apache-2.0"
] | 2 | 2021-08-06T23:43:42.000Z | 2021-08-06T23:45:55.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 32 | 90 | 0.670259 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.