hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2d68099f18b49ae149927e97438f483a81e6176c | 1,580 | py | Python | ch01_arrays_and_strings/1.7_rotate-matrix.py | appletreeisyellow/cracking-the-coding-interview | dc04c1c1e75a58bd543a298520f4595425f38104 | [
"MIT"
] | null | null | null | ch01_arrays_and_strings/1.7_rotate-matrix.py | appletreeisyellow/cracking-the-coding-interview | dc04c1c1e75a58bd543a298520f4595425f38104 | [
"MIT"
] | null | null | null | ch01_arrays_and_strings/1.7_rotate-matrix.py | appletreeisyellow/cracking-the-coding-interview | dc04c1c1e75a58bd543a298520f4595425f38104 | [
"MIT"
] | null | null | null | import unittest
"""
1.7 Rotate Matrix:
Given an image represented by an NxN matrix, where each
pixel in the image is 4 bytes, write a method to rotate
the image by 90 degrees. Can you do this in place?
"""
def rotate_matrix(matrix):
# assume the rotation is clock-wise
if len(matrix) == 0 or len(matrix... | 22.571429 | 76 | 0.532911 |
2d680b48a9cf0439011ef243a54400c8601412f0 | 301 | py | Python | tests/test_mantle/mux/mothball/mux4.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 14 | 2017-10-08T09:16:10.000Z | 2021-11-27T19:12:24.000Z | tests/test_mantle/mux/mothball/mux4.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 7 | 2018-04-12T21:33:49.000Z | 2018-08-21T22:14:20.000Z | tests/test_mantle/mux/mothball/mux4.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 3 | 2018-07-24T04:55:02.000Z | 2019-12-30T08:12:39.000Z | from magma import wire, compile, EndCircuit
from loam.boards.icestick import IceStick, Mux
icestick = IceStick()
for i in range(6):
icestick.J1[i].input().on()
icestick.D1.on()
main = icestick.main()
I = main.J1[0:4]
S = main.J1[4:6]
mux = Mux(4)
mux( I, S )
wire(mux.O, main.D1)
EndCircuit()
| 16.722222 | 46 | 0.674419 |
2d682e9024306b944011edfe0b3e881d54b60eb7 | 5,639 | py | Python | homecontrol/dependencies/state_engine.py | jaipradeesh/HomeControl | 79ffe8a403fb53e3faf91f55f66d912bb62b4f5f | [
"MIT"
] | null | null | null | homecontrol/dependencies/state_engine.py | jaipradeesh/HomeControl | 79ffe8a403fb53e3faf91f55f66d912bb62b4f5f | [
"MIT"
] | null | null | null | homecontrol/dependencies/state_engine.py | jaipradeesh/HomeControl | 79ffe8a403fb53e3faf91f55f66d912bb62b4f5f | [
"MIT"
] | null | null | null | """StateEngine module"""
import logging
from typing import Callable, Any
import voluptuous as vol
from homecontrol.dependencies.data_types import types
from homecontrol.const import ItemStatus
from homecontrol.exceptions import (
ItemNotOnlineError
)
LOGGER = logging.getLogger(__name__)
class StateEngine:
"... | 35.24375 | 79 | 0.577053 |
2d68717a6183a2a0a0daf0245452ad27052155ee | 1,062 | py | Python | tests/test_fuel_types.py | fusion-energy/openmc-plasma-source | 15c2194c1f386bf60514dde6797545f6615a1605 | [
"MIT"
] | 9 | 2021-09-22T13:30:32.000Z | 2022-03-31T14:52:50.000Z | tests/test_fuel_types.py | fusion-energy/openmc-plasma-source | 15c2194c1f386bf60514dde6797545f6615a1605 | [
"MIT"
] | 46 | 2021-09-22T09:41:40.000Z | 2022-03-23T09:48:37.000Z | tests/test_fuel_types.py | fusion-energy/openmc-plasma-source | 15c2194c1f386bf60514dde6797545f6615a1605 | [
"MIT"
] | 6 | 2021-09-23T10:32:41.000Z | 2022-01-24T10:17:40.000Z | from openmc_plasma_source.fuel_types import Fuel, fuel_types
import pytest
@pytest.mark.parametrize("energy,mass", [(2.5e7, 5), (15, 30)])
def test_fuel_with_correct_inputs(energy, mass):
# Should accept any non-zero positive inputs to either variable
fuel = Fuel(energy, mass)
assert fuel.mean_energy == e... | 32.181818 | 81 | 0.693032 |
2d688a3aaa012b11bfb246a116783fa1823a5d24 | 31,852 | py | Python | scapy/scapy/layers/tls/crypto/groups.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | scapy/scapy/layers/tls/crypto/groups.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | scapy/scapy/layers/tls/crypto/groups.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | # This file is part of Scapy
# Copyright (C) 2007, 2008, 2009 Arnaud Ebalard
# 2015, 2016, 2017 Maxence Tury
# This program is published under a GPLv2 license
"""
This is a register for DH groups from RFC 3526 and RFC 4306.
At this time the groups from RFC 7919 have not been registered by openssl,
thus t... | 45.308677 | 84 | 0.694274 |
2d688d51a740e4d5a10c08a2faed27bfbd008fa1 | 1,482 | py | Python | datar/tidyr/drop_na.py | stjordanis/datar | 4e2b5db026ad35918954576badef9951928c0cb1 | [
"MIT"
] | 110 | 2021-03-09T04:10:40.000Z | 2022-03-13T10:28:20.000Z | datar/tidyr/drop_na.py | sthagen/datar | 1218a549e2f0547c7b5a824ca6d9adf1bf96ba46 | [
"MIT"
] | 54 | 2021-06-20T18:53:44.000Z | 2022-03-29T22:13:07.000Z | datar/tidyr/drop_na.py | sthagen/datar | 1218a549e2f0547c7b5a824ca6d9adf1bf96ba46 | [
"MIT"
] | 11 | 2021-06-18T03:03:14.000Z | 2022-02-25T11:48:26.000Z | """Drop rows containing missing values
https://github.com/tidyverse/tidyr/blob/HEAD/R/drop-na.R
"""
from pandas import DataFrame
from pipda import register_verb
from ..core.contexts import Context
from ..core.utils import arg_match, vars_select, reconstruct_tibble
@register_verb(DataFrame, context=Context.SELECT)
... | 31.531915 | 77 | 0.67004 |
2d688e1fccd5a1ec8fee96b19bba3fbaafb7820b | 4,474 | py | Python | calendarserver/test/test_logAnalysis.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | calendarserver/test/test_logAnalysis.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | calendarserver/test/test_logAnalysis.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | ##
# Copyright (c) 2012-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 50.840909 | 122 | 0.589852 |
2d68a6da0eba61f1b82ce4510a56de19ed7f2770 | 299 | py | Python | tests/test_mantle/mothball/compare/ge4.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 14 | 2017-10-08T09:16:10.000Z | 2021-11-27T19:12:24.000Z | tests/test_mantle/mothball/compare/ge4.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 7 | 2018-04-12T21:33:49.000Z | 2018-08-21T22:14:20.000Z | tests/test_mantle/mothball/compare/ge4.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 3 | 2018-07-24T04:55:02.000Z | 2019-12-30T08:12:39.000Z | import sys
from magma import *
from mantle import *
from loam.shields.megawing import MegaWing
megawing = MegaWing()
megawing.Switch.on(8)
megawing.LED.on(1)
main = megawing.main()
A = main.SWITCH[0:4]
B = main.SWITCH[4:8]
O = main.LED[0]
ge4 = GE(4)
O(ge4(A, B))
compile(sys.argv[1], main)
| 13 | 42 | 0.688963 |
2d68b36b53edfa1f3206ff9dda190a9d11efad14 | 5,154 | py | Python | program_synthesis/karel/models/base.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 123 | 2018-06-09T00:49:39.000Z | 2022-03-09T05:41:20.000Z | program_synthesis/karel/models/base.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 9 | 2018-06-12T01:01:17.000Z | 2022-03-18T09:06:39.000Z | program_synthesis/karel/models/base.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 24 | 2018-06-09T00:42:46.000Z | 2021-09-29T08:23:32.000Z | import collections
import math
import sys
import os
import time
import numpy as np
import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
import torchfold
from program_synthesis.common.tools import saver
from program_synthesis.karel.dataset import data
from program_synthesis.kar... | 33.907895 | 97 | 0.613116 |
2d68b898408df8a531712d5ce8ee760863fa067c | 99 | py | Python | agutil/parallel/src/exceptions.py | agraubert/agutil | d9a568df01959ed985c9c8e77bdd501ac13bdbbf | [
"MIT"
] | 3 | 2017-06-05T15:46:22.000Z | 2019-05-22T21:26:54.000Z | agutil/parallel/src/exceptions.py | agraubert/agutil | d9a568df01959ed985c9c8e77bdd501ac13bdbbf | [
"MIT"
] | 93 | 2016-06-22T18:57:47.000Z | 2022-02-14T10:50:27.000Z | agutil/parallel/src/exceptions.py | agraubert/agutil | d9a568df01959ed985c9c8e77bdd501ac13bdbbf | [
"MIT"
] | null | null | null | class _ParallelBackgroundException(Exception):
def __init__(self, exc):
self.exc = exc
| 24.75 | 46 | 0.707071 |
2d68c0f30b0e8de51cd30a38f3e0e0f5ce9879da | 1,863 | py | Python | nanotune/tests/tuningstages/test_chargediagram_tasks.py | microsoft/nanotune | 68be8f5b74a52d57b74ccac228e120d9ab48e3e4 | [
"MIT"
] | 5 | 2021-02-24T14:32:37.000Z | 2022-01-05T16:37:26.000Z | nanotune/tests/tuningstages/test_chargediagram_tasks.py | microsoft/nanotune | 68be8f5b74a52d57b74ccac228e120d9ab48e3e4 | [
"MIT"
] | 149 | 2021-03-23T14:44:39.000Z | 2022-03-31T06:09:07.000Z | nanotune/tests/tuningstages/test_chargediagram_tasks.py | LaudateCorpus1/nanotune | 0ada354597b16f6dbb17ca7be01ab7668b6d5049 | [
"MIT"
] | 10 | 2021-03-29T13:36:38.000Z | 2022-02-16T23:06:35.000Z | # Copyright (c) 2021 Jana Darulova
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import pytest
from nanotune.tuningstages.chargediagram_tasks import *
from nanotune.fit.dotfit import DotFit
from nanotune.tests.mock_classifier import MockClassifer
def test_segment_dot_data(... | 34.5 | 90 | 0.688137 |
2d68dfa96a5d33cde297185319a482af24feaeb9 | 1,379 | py | Python | test/test_topology_lib_ip.py | HPENetworking/topology_lib_ip | c69cc3db80d96575d787fdc903a9370d2df1c5ae | [
"Apache-2.0"
] | 2 | 2016-03-01T18:39:44.000Z | 2018-05-12T07:56:42.000Z | test/test_topology_lib_ip.py | HPENetworking/topology_lib_ip | c69cc3db80d96575d787fdc903a9370d2df1c5ae | [
"Apache-2.0"
] | 6 | 2016-01-25T19:46:54.000Z | 2016-06-13T20:42:29.000Z | test/test_topology_lib_ip.py | HPENetworking/topology_lib_ip | c69cc3db80d96575d787fdc903a9370d2df1c5ae | [
"Apache-2.0"
] | 14 | 2016-01-21T17:40:22.000Z | 2020-10-20T19:03:20.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP
#
# 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
... | 27.039216 | 75 | 0.73314 |
2d68f4739c50ca8c559c63894024278675aee015 | 9,860 | py | Python | scripts/python/backend_server/wsgi/tim.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | 2 | 2020-06-03T15:59:50.000Z | 2020-12-21T11:11:57.000Z | scripts/python/backend_server/wsgi/tim.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | null | null | null | scripts/python/backend_server/wsgi/tim.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | 2 | 2019-10-02T06:47:23.000Z | 2020-02-02T18:32:23.000Z | #!/usr/bin/env python
# *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
# ** Copyright UCAR (c) 1992 - 2015
# ** University Corporation for Atmospheric Research(UCAR)
# ** National Center for Atmospheric Research(NCAR)
# ** Research Applications Laboratory(RAL)
# ** P.O.Box 3000, Boulder, Col... | 31.401274 | 111 | 0.612069 |
2d68ff292840be479bed1edb2546e19ca904a0e0 | 10,068 | py | Python | managers/jobs_manager.py | renuchauhan625/RazorPyOfficial | e5e3c2cb638b0e402f665aa2e756debd7c456237 | [
"Apache-2.0"
] | 3 | 2021-07-11T03:52:50.000Z | 2022-01-06T11:30:08.000Z | managers/jobs_manager.py | renuchauhan625/RazorPyOfficial | e5e3c2cb638b0e402f665aa2e756debd7c456237 | [
"Apache-2.0"
] | null | null | null | managers/jobs_manager.py | renuchauhan625/RazorPyOfficial | e5e3c2cb638b0e402f665aa2e756debd7c456237 | [
"Apache-2.0"
] | 1 | 2021-07-18T05:42:40.000Z | 2021-07-18T05:42:40.000Z | '''
Created on 01-Feb-2021
@author: Abhishek Prajapati
'''
from json import loads, dumps
import sys
from time import time, sleep
from jinja2 import Template
from os import path
from managers.service_object_manager import ObjectManager
from managers.vars_manager import AppsVars
from pyexception.RazorException import R... | 48.873786 | 178 | 0.447457 |
2d694d6e452f0777bb029e84c613af5d5487adb2 | 5,157 | py | Python | utils/magic_module/schema/resource.py | zengchen1024/developing_util | 071ab31b3946eea0e1c982dc5f8b9a3e5231a5f9 | [
"Apache-2.0"
] | null | null | null | utils/magic_module/schema/resource.py | zengchen1024/developing_util | 071ab31b3946eea0e1c982dc5f8b9a3e5231a5f9 | [
"Apache-2.0"
] | null | null | null | utils/magic_module/schema/resource.py | zengchen1024/developing_util | 071ab31b3946eea0e1c982dc5f8b9a3e5231a5f9 | [
"Apache-2.0"
] | 1 | 2018-09-28T01:52:15.000Z | 2018-09-28T01:52:15.000Z | import pystache
import re
from common.utils import build_path
class _Resource(object):
def __init__(self, name, service_type, parameter, properties, identity):
self._name = name
self._service_type = service_type
self._paths = {}
self._msg_prefix = {}
self._description = ""... | 27.725806 | 78 | 0.537134 |
2d694f00dd372ec7ba23bf817ba26859cc22281a | 1,538 | py | Python | samples/isql_query.py | kant/python-itoolkit | 179523134cac3f380f88bd76be8b8c97896c7b29 | [
"MIT"
] | 11 | 2019-01-09T12:31:04.000Z | 2021-08-29T05:26:35.000Z | samples/isql_query.py | kant/python-itoolkit | 179523134cac3f380f88bd76be8b8c97896c7b29 | [
"MIT"
] | 50 | 2018-12-21T18:52:25.000Z | 2021-05-25T13:38:15.000Z | samples/isql_query.py | kant/python-itoolkit | 179523134cac3f380f88bd76be8b8c97896c7b29 | [
"MIT"
] | 9 | 2018-12-25T00:02:19.000Z | 2022-02-22T00:58:13.000Z | # strsql
#
# ===> select * from QIWS/QCUSTCDT where LSTNAM='Jones' or LSTNAM='Vine'
#
# Display Data
# Data width . . . . . . : 102
# Position to line . . . . . Shift to column . . . . . .
# ....+....1....+..... | 34.177778 | 102 | 0.504551 |
2d695b29d96345126c75293e8a03961458282480 | 6,829 | py | Python | migrations/versions/32cd1aa56e70_.py | ags68/CS4398Project | a9652a3670fdbfd2f482104b77573a2d1f138c69 | [
"Unlicense"
] | 3 | 2017-02-27T02:13:52.000Z | 2017-03-05T03:54:25.000Z | migrations/versions/32cd1aa56e70_.py | ags68/CS4398Project | a9652a3670fdbfd2f482104b77573a2d1f138c69 | [
"Unlicense"
] | null | null | null | migrations/versions/32cd1aa56e70_.py | ags68/CS4398Project | a9652a3670fdbfd2f482104b77573a2d1f138c69 | [
"Unlicense"
] | null | null | null | """empty message
Revision ID: 32cd1aa56e70
Revises:
Create Date: 2017-04-12 18:52:29.624000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '32cd1aa56e70'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | 58.367521 | 115 | 0.720603 |
2d696c99a0220adcccd434ce93fa45c2287cb7e5 | 2,999 | py | Python | tests/test_robot.py | melexis/warnings-plugin | 6f821f5c82c2cdf37988d28e651646e1452faf43 | [
"Apache-2.0"
] | 7 | 2017-04-21T12:05:23.000Z | 2019-12-12T13:37:07.000Z | tests/test_robot.py | melexis/warnings-plugin | 6f821f5c82c2cdf37988d28e651646e1452faf43 | [
"Apache-2.0"
] | 100 | 2017-04-24T10:50:33.000Z | 2022-02-18T10:39:42.000Z | tests/test_robot.py | melexis/warnings-plugin | 6f821f5c82c2cdf37988d28e651646e1452faf43 | [
"Apache-2.0"
] | 2 | 2017-05-23T11:50:59.000Z | 2019-11-06T09:26:33.000Z | from io import StringIO
from unittest import TestCase
from unittest.mock import patch
from mlx.robot_checker import RobotSuiteChecker
from mlx.warnings import WarningsPlugin
class TestRobotWarnings(TestCase):
def setUp(self):
self.warnings = WarningsPlugin(verbose=True)
self.dut = self.warnings.... | 38.948052 | 85 | 0.628543 |
2d696db78f3b07e613d83502a8bafdca7cd35227 | 5,001 | py | Python | dataprep/clean/clean_ean.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 1,229 | 2019-12-21T02:58:59.000Z | 2022-03-30T08:12:33.000Z | dataprep/clean/clean_ean.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 680 | 2019-12-19T06:09:23.000Z | 2022-03-31T04:15:25.000Z | dataprep/clean/clean_ean.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 170 | 2020-01-08T03:27:26.000Z | 2022-03-20T20:42:55.000Z | """
Clean and validate a DataFrame column containing
EAN (International Article Number).
"""
# pylint: disable=too-many-lines, too-many-arguments, too-many-branches, unused-argument
from typing import Any, Union
from operator import itemgetter
import dask.dataframe as dd
import numpy as np
import pandas as pd
from st... | 29.075581 | 97 | 0.609878 |
2d697a1f8e710dd4e71dafbe77d02a2e8740d811 | 266 | py | Python | peartree/settings.py | yiyange/peartree | eb4fdab7a8484a621a0ee78d7723858b5ca2ac27 | [
"MIT"
] | 136 | 2017-11-21T22:45:12.000Z | 2022-03-25T14:10:26.000Z | peartree/settings.py | yiyange/peartree | eb4fdab7a8484a621a0ee78d7723858b5ca2ac27 | [
"MIT"
] | 156 | 2017-11-30T21:15:47.000Z | 2021-10-31T17:22:55.000Z | peartree/settings.py | yiyange/peartree | eb4fdab7a8484a621a0ee78d7723858b5ca2ac27 | [
"MIT"
] | 14 | 2018-01-01T19:03:35.000Z | 2021-08-12T17:48:51.000Z | import logging as lg
log_name = 'peartree'
log_filename = 'peartree'
log_file = False
log_console = False
log_level = lg.INFO
# Set some globals here that
# are used as reference throughout lib
WGS84 = 4326 # degree measurement
WEB_MERCATOR = 3857 # meter-based
| 20.461538 | 38 | 0.759398 |
2d69813a211481361d40bb8056f16765b2cc285b | 2,961 | py | Python | pagesext/tests/test_settings.py | dlancer/django-pages-cms-extensions | 4aa6f2780abef9543ced20258ede01a9662167b3 | [
"BSD-3-Clause"
] | 1 | 2016-07-08T07:23:20.000Z | 2016-07-08T07:23:20.000Z | pagesext/tests/test_settings.py | dlancer/django-pages-cms-extensions | 4aa6f2780abef9543ced20258ede01a9662167b3 | [
"BSD-3-Clause"
] | null | null | null | pagesext/tests/test_settings.py | dlancer/django-pages-cms-extensions | 4aa6f2780abef9543ced20258ede01a9662167b3 | [
"BSD-3-Clause"
] | null | null | null | import os
from django.utils.translation import ugettext_lazy as _
SITE_ID = 1
BASE_DIR = os.path.dirname(__file__)
# Absolute filesystem path to the directory that will hold user-uploaded files.
STATIC_ROOT = os.path.join(BASE_DIR, 'web/static')
STATIC_URL = '/static/'
ROOT_URLCONF = 'urls'
SECRET_KEY = 'secretkey... | 26.20354 | 103 | 0.673421 |
2d69b0d62f51cd34a5f2f95c0e2c26d673fa7bf1 | 6,156 | py | Python | sprints/freckle_api.py | bitmazk/django-trello-freckle-sprints | ee94960fe3b37c5f5de05634c7f0f3becdf4d17c | [
"MIT"
] | null | null | null | sprints/freckle_api.py | bitmazk/django-trello-freckle-sprints | ee94960fe3b37c5f5de05634c7f0f3becdf4d17c | [
"MIT"
] | null | null | null | sprints/freckle_api.py | bitmazk/django-trello-freckle-sprints | ee94960fe3b37c5f5de05634c7f0f3becdf4d17c | [
"MIT"
] | 1 | 2018-03-27T16:20:21.000Z | 2018-03-27T16:20:21.000Z | """
Helper method to fetch data from the Freckle API.
See http://developer.letsfreckle.com
"""
import json
import re
import requests
class FreckleClient(object):
"""Base class for Freckle API access."""
def __init__(self, account_name, api_token, rate):
self.account_name = account_name
self... | 38.716981 | 77 | 0.524204 |
2d69d275525dba89ff0c7823e21bf95e3873f566 | 7,653 | py | Python | salt/cloud/clouds/botocore_aws.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 2 | 2015-08-04T21:54:38.000Z | 2019-04-25T21:47:08.000Z | salt/cloud/clouds/botocore_aws.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/cloud/clouds/botocore_aws.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"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 ... | 30.612 | 79 | 0.650856 |
2d69d473f2ce8b8b68ecbc2df36e67bf1cbd01dd | 19,062 | py | Python | simple_app/plots.py | Will-Cooper/SIMPLE-web | 166d2508909c9ce041db28699d5496a5a173be92 | [
"BSD-3-Clause"
] | 2 | 2021-01-04T05:32:28.000Z | 2021-04-27T19:28:45.000Z | simple_app/plots.py | Will-Cooper/SIMPLE-web | 166d2508909c9ce041db28699d5496a5a173be92 | [
"BSD-3-Clause"
] | 61 | 2020-10-20T20:32:26.000Z | 2022-03-29T20:55:30.000Z | simple_app/plots.py | Will-Cooper/SIMPLE-web | 166d2508909c9ce041db28699d5496a5a173be92 | [
"BSD-3-Clause"
] | 5 | 2020-10-20T20:27:47.000Z | 2022-02-15T21:40:50.000Z | """
File containing the 'workhorse' functions generating the various plots seen on the website
"""
# external packages
import numpy as np
import pandas as pd
import astropy.units as u
from astropy.table import Table
from bokeh.embed import components
from bokeh.layouts import row, column # bokeh displaying nicely
from... | 52.224658 | 119 | 0.630574 |
2d69f1b623e67f43d10dc3410d8c9eac837ad018 | 17,604 | py | Python | rkd/dynamics_algorithms.py | iro-upgto/rkd | 7823781ddc81a9dac18fed55080205e8ed68b57b | [
"MIT"
] | null | null | null | rkd/dynamics_algorithms.py | iro-upgto/rkd | 7823781ddc81a9dac18fed55080205e8ed68b57b | [
"MIT"
] | null | null | null | rkd/dynamics_algorithms.py | iro-upgto/rkd | 7823781ddc81a9dac18fed55080205e8ed68b57b | [
"MIT"
] | null | null | null | import numpy as np
from sympy import *
from sympy.matrices import Matrix, eye
from rkd.abc import *
def Dh(a,alpha,d,theta):
"""
Calculates Denavit-Hartenberg matrix given the four parameters.
Parameters
----------
a : int, float or symbol
DH parameter
alpha : int, float or symbol
... | 40.100228 | 144 | 0.496819 |
2d69f7769ab94e7ac30cd535e14024d9308887f5 | 12,133 | py | Python | src/test/tests/rendering/viewChange.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/rendering/viewChange.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/rendering/viewChange.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: viewChange.py
#
# Tests: mesh - structured grid
# plots - pc
# operators - slice
# selection - none
#
# Defect ID: VisIt00003350, VisIt000032263
#
... | 26.962222 | 79 | 0.663645 |
2d6a171bef949460f7ef17edf251bb7091ae81b1 | 4,115 | py | Python | venv/Lib/site-packages/testfunctions.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/testfunctions.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/testfunctions.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import unittest
import re
import glob
import inspect
import ibm_db
import config
if sys.version_info >=(3,3 ):
from io import StringIO
else:
from io import StringIO
class IbmDbTestFunctions(unittest.TestCase):
prepconn = ibm_db.connect(config.database, config.user, config.password)
se... | 35.17094 | 133 | 0.660267 |
2d6a3b09c0b4235c06e52438fc5320022ca95793 | 1,439 | py | Python | tasks.py | baskluiters/cpp-documentation-example | 255cf63f101a8b44e1ca384db227babe737db4a4 | [
"CC0-1.0"
] | null | null | null | tasks.py | baskluiters/cpp-documentation-example | 255cf63f101a8b44e1ca384db227babe737db4a4 | [
"CC0-1.0"
] | null | null | null | tasks.py | baskluiters/cpp-documentation-example | 255cf63f101a8b44e1ca384db227babe737db4a4 | [
"CC0-1.0"
] | null | null | null | from pathlib import Path
import platform
import os
from invoke import task
@task
def install(inv):
"""
Install all the prerequisites through homebrew
Args:
inv: The invoke parser
"""
casks_to_install = (
"python3",
"graphviz",
"java",
"cmake",
... | 15.813187 | 79 | 0.580264 |
2d6a4762ae953cd647536aa3641c681d94be7cd4 | 1,408 | py | Python | tests/modules_test/cli_test.py | Twiker-Bot/twiker | ae39c4527d886913a137f1eea23cef467071022b | [
"MIT"
] | 2 | 2021-09-23T18:24:12.000Z | 2021-09-23T21:14:21.000Z | tests/modules_test/cli_test.py | Twiker-Bot/twiker | ae39c4527d886913a137f1eea23cef467071022b | [
"MIT"
] | 1 | 2021-09-26T15:12:52.000Z | 2021-09-27T13:36:00.000Z | tests/modules_test/cli_test.py | Twiker-Bot/twiker | ae39c4527d886913a137f1eea23cef467071022b | [
"MIT"
] | 1 | 2021-09-27T05:46:19.000Z | 2021-09-27T05:46:19.000Z | #!/bin/env python3.9
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2021 The Knight All rights reserved.
==========================
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 ... | 36.102564 | 77 | 0.768466 |
2d6a57dacdcf993ec1f08496da8e906f73562f93 | 3,027 | py | Python | pkg/distro/packaging_test.py | konste/rules_pkg | b5737c050f6bbc7e90895ea41602af953013cfb9 | [
"Apache-2.0"
] | null | null | null | pkg/distro/packaging_test.py | konste/rules_pkg | b5737c050f6bbc7e90895ea41602af953013cfb9 | [
"Apache-2.0"
] | null | null | null | pkg/distro/packaging_test.py | konste/rules_pkg | b5737c050f6bbc7e90895ea41602af953013cfb9 | [
"Apache-2.0"
] | 1 | 2020-08-19T14:53:06.000Z | 2020-08-19T14:53:06.000Z | # Copyright 2019 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... | 35.197674 | 80 | 0.691444 |
2d6a5b6226e659e373be8e490571983d56201eb7 | 1,375 | py | Python | oscar/lib/python2.7/site-packages/django/contrib/admindocs/middleware.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/contrib/admindocs/middleware.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/contrib/admindocs/middleware.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from django import http
from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
class XViewMiddleware(MiddlewareMixin):
"""
Adds an X-View header to internal HEAD requests -- used by the documentation system.
"""
def process_view(self, request, view_func, view_ar... | 47.413793 | 101 | 0.632 |
2d6a8ccad0e6dac058446e235f99e392d1ffd54c | 2,363 | py | Python | assign.py | hashirshoaeb/Polygon-classifier | 9c291f31f8adabd5df06903ccc7c707efae13e8c | [
"MIT"
] | 1 | 2020-10-22T03:00:51.000Z | 2020-10-22T03:00:51.000Z | assign.py | hashirshoaeb/Polygon-classifier | 9c291f31f8adabd5df06903ccc7c707efae13e8c | [
"MIT"
] | null | null | null | assign.py | hashirshoaeb/Polygon-classifier | 9c291f31f8adabd5df06903ccc7c707efae13e8c | [
"MIT"
] | null | null | null | import numpy as np
import cv2 as cv
import blob as b
import csv as cs
import math as m
import os
# importing training images
training_imgs = []
training_dir = './train'
img_paths = os.listdir(training_dir)
for img_path in img_paths:
t = cv.imread(training_dir + '/' + img_path, 0)
training_imgs.append(t)
# imp... | 32.369863 | 121 | 0.697842 |
2d6a95b49e707d5fd1c90d3e338a8310e806e0fb | 1,379 | py | Python | src/test/tinc/tincrepo/mpp/models/mpp_scenario_tc.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 9 | 2018-04-20T03:31:01.000Z | 2020-05-13T14:10:53.000Z | src/test/tinc/tincrepo/mpp/models/mpp_scenario_tc.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 36 | 2017-09-21T09:12:27.000Z | 2020-06-17T16:40:48.000Z | src/test/tinc/tincrepo/mpp/models/mpp_scenario_tc.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 32 | 2017-08-31T12:50:52.000Z | 2022-03-01T07:34:53.000Z | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | 37.27027 | 94 | 0.750544 |
2d6aa1f186a5c72c275744e964a1aff96a381247 | 8,270 | py | Python | src/reponews/core.py | jwodder/reponews | b0a7af1cb382efc1993fc16a343c2282621ae118 | [
"MIT"
] | 1 | 2021-11-30T03:52:55.000Z | 2021-11-30T03:52:55.000Z | src/reponews/core.py | jwodder/reponews | b0a7af1cb382efc1993fc16a343c2282621ae118 | [
"MIT"
] | 5 | 2021-11-30T19:10:29.000Z | 2021-12-02T22:22:19.000Z | src/reponews/core.py | jwodder/reponews | b0a7af1cb382efc1993fc16a343c2282621ae118 | [
"MIT"
] | null | null | null | from __future__ import annotations
from dataclasses import dataclass, field
from datetime import datetime
from email.message import EmailMessage
import json
from operator import attrgetter
from pathlib import Path
from typing import Any, Dict, Iterator, List, Set, Tuple
from eletter import compose
from pydantic import ... | 35.800866 | 87 | 0.569528 |
2d6aa45b54783016f91af4432aa38c722314bfc6 | 1,409 | py | Python | modules/iib_exec_groups.py | satbel/ib-metrics-pyclient | 1670df55684a7182884fcfc777fde5ae44095f8f | [
"MIT"
] | null | null | null | modules/iib_exec_groups.py | satbel/ib-metrics-pyclient | 1670df55684a7182884fcfc777fde5ae44095f8f | [
"MIT"
] | null | null | null | modules/iib_exec_groups.py | satbel/ib-metrics-pyclient | 1670df55684a7182884fcfc777fde5ae44095f8f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Various functions for ib execution groups."""
from modules.iib_api import get_status
def get_metric_name(metric_label):
"""Returns pushgateway formatted metric name."""
return 'ib_exec_group_{0}'.format(metric_label)
def get_metric_annotation():
"""Returns dictionary with anno... | 36.128205 | 102 | 0.64159 |
2d6acb3932b67eb8430c417a9372a0204389b7d4 | 4,610 | py | Python | external/sbml/bindings/python/test/sbml/TestAssignmentRule.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | 1 | 2019-08-22T17:17:41.000Z | 2019-08-22T17:17:41.000Z | external/sbml/bindings/python/test/sbml/TestAssignmentRule.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | null | null | null | external/sbml/bindings/python/test/sbml/TestAssignmentRule.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | null | null | null | #
# @file TestAssignmentRule.py
# @brief AssignmentRule unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Ben Bornstein
#
# $Id: TestAssignmentRule.py 10124 2009-08-28 12:04:51Z sarahkeating $
# $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/bindings/python/test/sbml/... | 34.924242 | 125 | 0.655315 |
2d6b5e8234f7990cad00bf49c31c3729fc3b3195 | 1,406 | py | Python | alipay/aop/api/domain/Attachment.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/Attachment.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/Attachment.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class Attachment(object):
def __init__(self):
self._attachment_name = None
self._file_id = None
@property
def attachment_name(self):
return self._attachment_name
@... | 25.107143 | 81 | 0.594595 |
2d6b626593d078dc2144c9872a8dddd94c3dfccd | 1,794 | py | Python | scripts/artifacts/userDict.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | scripts/artifacts/userDict.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | scripts/artifacts/userDict.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | from scripts.ilapfuncs import open_sqlite_db_readonly
from scripts.plugin_base import ArtefactPlugin
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv
from scripts import artifact_report
class UserDictPlugin(ArtefactPlugin):
"""
"""
def __init__(self):
... | 31.473684 | 167 | 0.62709 |
2d6b79e83f70952bf8ed18b619d7a212576d7baa | 2,322 | py | Python | fedot/core/pipelines/validation.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 358 | 2020-06-11T09:34:53.000Z | 2022-03-31T12:56:22.000Z | fedot/core/pipelines/validation.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 467 | 2020-06-11T13:49:45.000Z | 2022-03-31T14:19:48.000Z | fedot/core/pipelines/validation.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 48 | 2020-07-13T14:50:45.000Z | 2022-03-26T09:37:13.000Z | from typing import Callable, List
from fedot.core.dag.graph import Graph
from fedot.core.dag.graph_node import GraphNode
from fedot.core.repository.tasks import TaskTypesEnum
from fedot.core.dag.validation_rules import DEFAULT_DAG_RULES, has_no_cycle, has_no_isolated_nodes, \
has_no_self_cycled_nodes, has_one_root... | 39.355932 | 107 | 0.731697 |
2d6bc501a72edf9d27741ae96d08d90d9eeac067 | 5,652 | py | Python | insta/views.py | JKimani77/instagramclone | 87481a7e721f91f0b370be51f23266df996a9c5e | [
"MIT"
] | null | null | null | insta/views.py | JKimani77/instagramclone | 87481a7e721f91f0b370be51f23266df996a9c5e | [
"MIT"
] | null | null | null | insta/views.py | JKimani77/instagramclone | 87481a7e721f91f0b370be51f23266df996a9c5e | [
"MIT"
] | null | null | null | from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login, authenticate, logout
from django.contrib.sites.shortcuts import get_current_site
from dj... | 33.247059 | 97 | 0.643135 |
2d6bd4a8a86f2659cfd8872449893912dd4ba402 | 3,853 | py | Python | recognition/test.py | hudmgy/insightface | 2ebc87e1bde3d4ef04bc0d4498038a0bc01b0ddc | [
"MIT"
] | 1 | 2019-08-05T00:54:27.000Z | 2019-08-05T00:54:27.000Z | recognition/test.py | hudmgy/insightface | 2ebc87e1bde3d4ef04bc0d4498038a0bc01b0ddc | [
"MIT"
] | null | null | null | recognition/test.py | hudmgy/insightface | 2ebc87e1bde3d4ef04bc0d4498038a0bc01b0ddc | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import math
import time
import random
import logging
#import sklearn
import pickle
import numpy as np
import mxnet as mx
from mxnet import ndarray as nd
import argparse
import mxnet.optimiz... | 27.92029 | 110 | 0.683104 |
2d6c0a1342a307446383b797ba2936436110bc8f | 623 | py | Python | src/graph_transpiler/webdnn/graph/operators/leaky_relu.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | 1 | 2018-07-26T13:52:21.000Z | 2018-07-26T13:52:21.000Z | src/graph_transpiler/webdnn/graph/operators/leaky_relu.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | src/graph_transpiler/webdnn/graph/operators/leaky_relu.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | from typing import Optional
from webdnn.graph.operators.elementwise import Elementwise
class LeakyRelu(Elementwise):
"""LeakyRelu(name, slope)
Leaky relu operator
.. math::
f(x) = max(x, ax)
where :math:`a` is slope value.
Args:
slope (float): slope value
Signature
... | 19.46875 | 77 | 0.574639 |
2d6c30c5c0c132198a01de3a965afdb3ae37872a | 2,127 | py | Python | data_manipulation/psycopg2_.py | shawnngtq/data-manipulation | a5521a79821ed44f61a6fd6ef3617fb1aa530387 | [
"BSD-3-Clause"
] | 1 | 2020-12-21T18:39:22.000Z | 2020-12-21T18:39:22.000Z | data_manipulation/psycopg2_.py | shawnngtq/data-manipulation | a5521a79821ed44f61a6fd6ef3617fb1aa530387 | [
"BSD-3-Clause"
] | 3 | 2021-02-20T03:01:19.000Z | 2021-05-22T01:57:58.000Z | data_manipulation/psycopg2_.py | shawnngtq/data-manipulation | a5521a79821ed44f61a6fd6ef3617fb1aa530387 | [
"BSD-3-Clause"
] | null | null | null | def create_connection(host, dbname, user, password, port=5432):
"""
Return psycopg2 connection
https://www.psycopg.org/
Parameters
----------
host : str
Database host address
dbname : str
Database name
user : str
User used to authenticate
password : str
... | 21.059406 | 86 | 0.596145 |
2d6c44ce62999b9c39718c333ce8f8ac837841df | 6,570 | py | Python | python/akg/ops/math/gpu/tensorcore_batch_matmul.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | python/akg/ops/math/gpu/tensorcore_batch_matmul.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | python/akg/ops/math/gpu/tensorcore_batch_matmul.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 49.029851 | 155 | 0.641705 |
2d6c5e2c9269b155766b3eb7b61508ae648fccd5 | 11,894 | py | Python | plugin/disorganiser.py | nfd/disorganiser | fbec21fdcb8f5af8abbd5404e888703e15a2aa74 | [
"MIT"
] | 1 | 2019-04-10T13:26:21.000Z | 2019-04-10T13:26:21.000Z | plugin/disorganiser.py | nfd/disorganiser | fbec21fdcb8f5af8abbd5404e888703e15a2aa74 | [
"MIT"
] | null | null | null | plugin/disorganiser.py | nfd/disorganiser | fbec21fdcb8f5af8abbd5404e888703e15a2aa74 | [
"MIT"
] | null | null | null | import sys
import datetime
import re
import subprocess
import vim
from distable import dis_in_table, dis_table_tab, dis_table_cr, dis_table_reformat, dis_make_table_visual
from disops import dis_visual_perline_op
# General annoyance here is the difference between vim.current.window.cursor, which returns
# 1-indexed ... | 31.632979 | 135 | 0.655709 |
2d6c6a9cedf994e80809a8967ec96e90cab672dd | 2,461 | py | Python | setup.py | jrxk/forte | bb88412a23efa8b4b22f636c1e8073c18fab8c18 | [
"Apache-2.0"
] | null | null | null | setup.py | jrxk/forte | bb88412a23efa8b4b22f636c1e8073c18fab8c18 | [
"Apache-2.0"
] | null | null | null | setup.py | jrxk/forte | bb88412a23efa8b4b22f636c1e8073c18fab8c18 | [
"Apache-2.0"
] | null | null | null | import sys
import setuptools
from pathlib import Path
long_description = (Path(__file__).parent / "README.md").read_text()
if sys.version_info < (3, 6):
sys.exit('Python>=3.6 is required by Forte.')
setuptools.setup(
name="forte",
version="0.0.1a1",
url="https://github.com/asyml/forte",
descript... | 33.712329 | 76 | 0.552215 |
2d6c7846d0588ba8a6fd33e4592325476b3cc5a5 | 1,138 | py | Python | tests/test_database.py | Simple2B/cortex-backend | 9cf6802b0eff9254875bcbe553517500ccfc9082 | [
"MIT"
] | 1 | 2021-10-17T13:28:51.000Z | 2021-10-17T13:28:51.000Z | tests/test_database.py | Simple2B/cortex-backend | 9cf6802b0eff9254875bcbe553517500ccfc9082 | [
"MIT"
] | null | null | null | tests/test_database.py | Simple2B/cortex-backend | 9cf6802b0eff9254875bcbe553517500ccfc9082 | [
"MIT"
] | null | null | null | import pytest
from typing import Generator
from fastapi.testclient import TestClient
import tests.setup # noqa: F401
from app.database import engine, Base
from app.setup import create_app
# from app.models import (
# Client,
# Doctor,
# Visit,
# Reception,
# QueueMember,
# )
from .database impor... | 24.212766 | 56 | 0.675747 |
2d6c82b2bf7467755d0d361ccf81676958e4f0e4 | 2,043 | py | Python | oracle/user.py | Toofifty/Oracle2 | aea7db04d1f470cf04cf6b9b291b1fd47e4b6b4d | [
"MIT"
] | 1 | 2015-07-15T15:24:54.000Z | 2015-07-15T15:24:54.000Z | oracle/user.py | Toofifty/Oracle2 | aea7db04d1f470cf04cf6b9b291b1fd47e4b6b4d | [
"MIT"
] | null | null | null | oracle/user.py | Toofifty/Oracle2 | aea7db04d1f470cf04cf6b9b291b1fd47e4b6b4d | [
"MIT"
] | null | null | null | import db
import json, os, time, traceback
def get_user(name):
user = db.load_user(name)
if user is None:
print 'creating new user: ' + name
return User(name, name, 1, 0, 0)
return user
class User:
def __init__(self, nick, last_nick, rank, points, commands, seen=0):
self.name =... | 22.955056 | 78 | 0.573666 |
2d6c988cbcf5a7ceb63c9a4761625b775ea5ea48 | 22,036 | py | Python | networkx/generators/classic.py | joelmiller/networkx | ab8a13cfc8a0993d64dda680f4a9664a0078939e | [
"BSD-3-Clause"
] | null | null | null | networkx/generators/classic.py | joelmiller/networkx | ab8a13cfc8a0993d64dda680f4a9664a0078939e | [
"BSD-3-Clause"
] | null | null | null | networkx/generators/classic.py | joelmiller/networkx | ab8a13cfc8a0993d64dda680f4a9664a0078939e | [
"BSD-3-Clause"
] | null | null | null | """
Generators for some classic graphs.
The typical graph generator is called as follows:
>>> G=nx.complete_graph(100)
returning the complete graph on n nodes labeled 0,..,99
as a simple graph. Except for empty_graph, all the generators
in this module return a Graph class (i.e. a simple, undirected graph).
"""
# ... | 35.714749 | 126 | 0.635732 |
2d6cb0552055c49dfb5ee7b8b4c3ac9e9513758a | 636 | py | Python | debate/migrations/0021_auto_20170826_1419.py | steventimberman/debateIt | 32b17552894b2c54a5f57c36257f4b6bc8846711 | [
"MIT"
] | null | null | null | debate/migrations/0021_auto_20170826_1419.py | steventimberman/debateIt | 32b17552894b2c54a5f57c36257f4b6bc8846711 | [
"MIT"
] | 4 | 2017-08-16T03:50:16.000Z | 2017-08-22T05:41:04.000Z | debate/migrations/0021_auto_20170826_1419.py | steventimberman/masterDebater | 32b17552894b2c54a5f57c36257f4b6bc8846711 | [
"MIT"
] | 1 | 2020-11-04T08:39:22.000Z | 2020-11-04T08:39:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-26 19:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('debate', '0020_remove_point_debate_side'),
]
operations = [
migrations.Alte... | 24.461538 | 62 | 0.602201 |
2d6cd796da4bde9f0f5813ab6a1af9d63c73c401 | 13,509 | py | Python | trac/db/api.py | CoRfr/trac | 31509d77aa7cd3c6c0057a607313ceaed1f7a20b | [
"BSD-3-Clause"
] | null | null | null | trac/db/api.py | CoRfr/trac | 31509d77aa7cd3c6c0057a607313ceaed1f7a20b | [
"BSD-3-Clause"
] | null | null | null | trac/db/api.py | CoRfr/trac | 31509d77aa7cd3c6c0057a607313ceaed1f7a20b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C)2005-2009 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.e... | 33.521092 | 77 | 0.590939 |
2d6ce2fb754fc22aa404625a0cbb2c28c724af0e | 6,331 | py | Python | docs/en_US/conf.py | tblanchart/nni | bbb9137c323316d6de04e15d42cf6dc47a889fcc | [
"MIT"
] | null | null | null | docs/en_US/conf.py | tblanchart/nni | bbb9137c323316d6de04e15d42cf6dc47a889fcc | [
"MIT"
] | null | null | null | docs/en_US/conf.py | tblanchart/nni | bbb9137c323316d6de04e15d42cf6dc47a889fcc | [
"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.291866 | 133 | 0.662139 |
2d6cef5d8623758cb2f79c770ef3fd0451a41df5 | 14,103 | py | Python | load_into_pg.py | mkingopng/stackexchange-dump-to-postgres | 8bcb72858963daec7ee6688caef7a5f260f5489e | [
"MIT"
] | 70 | 2015-11-25T14:31:13.000Z | 2022-03-10T19:59:17.000Z | load_into_pg.py | musically-ut/stackexchange-dump-to-postgres | 8bcb72858963daec7ee6688caef7a5f260f5489e | [
"MIT"
] | 21 | 2016-11-07T19:41:10.000Z | 2022-03-12T05:31:40.000Z | load_into_pg.py | musically-ut/stackexchange-dump-to-postgres | 8bcb72858963daec7ee6688caef7a5f260f5489e | [
"MIT"
] | 32 | 2016-06-07T06:18:07.000Z | 2021-11-21T07:22:09.000Z | #!/usr/bin/env python
import sys
import time
import argparse
import psycopg2 as pg
import os
import row_processor as Processor
import six
import json
# Special rules needed for certain tables (esp. for old database dumps)
specialRules = {("Posts", "ViewCount"): "NULLIF(%(ViewCount)s, '')::int"}
# part of the file al... | 30.995604 | 92 | 0.508332 |
2d6d45a1dad82ad5bb2501363b6b55b5f09f5cdd | 626 | py | Python | test_wrap_nicely.py | mytechnotalent/CircuitPython-IoT-Trivia | ee4b403317f52051dd5df9a5fae116421867b695 | [
"Apache-2.0"
] | 1 | 2021-04-06T03:21:16.000Z | 2021-04-06T03:21:16.000Z | test_wrap_nicely.py | mytechnotalent/CircuitPython-IoT-Trivia | ee4b403317f52051dd5df9a5fae116421867b695 | [
"Apache-2.0"
] | null | null | null | test_wrap_nicely.py | mytechnotalent/CircuitPython-IoT-Trivia | ee4b403317f52051dd5df9a5fae116421867b695 | [
"Apache-2.0"
] | null | null | null | # import unittest
# unittest.main('test_wrap_nicely')
import unittest
import wrap_nicely
class TestWrapNicely(unittest.TestCase):
def test_wrap_nicely(self):
"""
test text wraps properly
"""
# Setup
string = 'A string of text to test to see if it wraps nicely'
ma... | 20.193548 | 69 | 0.533546 |
2d6d50abe31f034d56477a7a4399b5874116cc73 | 7,217 | py | Python | examples/app.py | valr/bootstrap-flask | d470b7fba1172fb05495ea601be6cf93d2962c79 | [
"BSD-3-Clause"
] | null | null | null | examples/app.py | valr/bootstrap-flask | d470b7fba1172fb05495ea601be6cf93d2962c79 | [
"BSD-3-Clause"
] | null | null | null | examples/app.py | valr/bootstrap-flask | d470b7fba1172fb05495ea601be6cf93d2962c79 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import Flask, render_template, request, flash, Markup, jsonify
from flask_wtf import FlaskForm, CSRFProtect
from wtforms import StringField, SubmitField, BooleanField, PasswordField, IntegerField, TextField,\
FormField, SelectField, FieldList
from wtforms.validators import DataRe... | 36.634518 | 182 | 0.678675 |
2d6d946b9df0401f951c6c518f849659395e9a2b | 4,867 | py | Python | turbulette/asgi.py | gitter-badger/turbulette | abc61b58033f4f53bbefe5a1e10bf6550d2ce86f | [
"BSD-3-Clause"
] | null | null | null | turbulette/asgi.py | gitter-badger/turbulette | abc61b58033f4f53bbefe5a1e10bf6550d2ce86f | [
"BSD-3-Clause"
] | null | null | null | turbulette/asgi.py | gitter-badger/turbulette | abc61b58033f4f53bbefe5a1e10bf6550d2ce86f | [
"BSD-3-Clause"
] | null | null | null | from importlib import import_module
from importlib.util import find_spec
from pathlib import Path
from typing import Optional
from gino_starlette import Gino
from sqlalchemy.engine.url import URL
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.routing import Rout... | 31.4 | 93 | 0.646394 |
2d6dad7a9b43d6a79e1e863c8e1a7ba0c322221b | 1,725 | py | Python | rindr/urls.py | claird160/rindr | 0ab9d77edf6258ab8f304fd4f1c5f92d96ff7a60 | [
"MIT"
] | null | null | null | rindr/urls.py | claird160/rindr | 0ab9d77edf6258ab8f304fd4f1c5f92d96ff7a60 | [
"MIT"
] | null | null | null | rindr/urls.py | claird160/rindr | 0ab9d77edf6258ab8f304fd4f1c5f92d96ff7a60 | [
"MIT"
] | null | null | null | """rindr URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/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 v... | 42.073171 | 78 | 0.724638 |
2d6dbafa2f497be624ce7e5bdec6e7c6d1506096 | 1,818 | py | Python | aoc-2020/day-17/day_17_part_1.py | bsamseth/advent-of-code-2018 | bdd3969e61fac3f1543c20983260aa9fda912e99 | [
"MIT"
] | 1 | 2021-01-03T17:09:13.000Z | 2021-01-03T17:09:13.000Z | aoc-2020/day-17/day_17_part_1.py | bsamseth/advent-of-code-2018 | bdd3969e61fac3f1543c20983260aa9fda912e99 | [
"MIT"
] | 3 | 2021-06-01T23:09:26.000Z | 2022-03-12T01:08:40.000Z | aoc-2020/day-17/day_17_part_1.py | bsamseth/advent-of-code | 65d40548057a86b6fda37aec8e7d5d473d627124 | [
"MIT"
] | null | null | null | import copy
from collections import namedtuple
Point = namedtuple("Point", ["z", "y", "x"])
def bounds(space):
z, y, x = zip(*(point for point, state in space.items() if state == "#"))
return Point(min(z), min(y), min(x)), Point(max(z), max(y), max(x))
def show(space):
min_bound, max_bound = bounds(spa... | 33.666667 | 84 | 0.469197 |
2d6de1a1d959ef0c43d0654f5ff5b602b3b68777 | 770 | py | Python | src/ggrc_risks/migrations/versions/20160114165223_17ae137bda7a_rename_controlassessment_to_assessment.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-01-03T02:49:23.000Z | 2018-01-03T02:49:23.000Z | src/ggrc_risks/migrations/versions/20160114165223_17ae137bda7a_rename_controlassessment_to_assessment.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | src/ggrc_risks/migrations/versions/20160114165223_17ae137bda7a_rename_controlassessment_to_assessment.py | zidarsk8/ggrc-core | 2509c989eddf434249d3bef50c21e08dbf56c1a4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Rename ControlAssessment to Assessment
Revision ID: 17ae137bda7a
Revises: 62f26762d0a
Create Date: 2016-01-14 16:52:23.706170
"""
# revision identifiers, used by Alembic.
revision = '17ae137bda7a'
down... | 24.83871 | 78 | 0.694805 |
2d6def6e7b343d04b0477985b420f1045cd8af24 | 877 | py | Python | sdks/python/test/test_RepoConfigs.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_RepoConfigs.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_RepoConfigs.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 21.925 | 81 | 0.703535 |
2d6df02d9c628584a5c4851bf255b8d3ba5f73d0 | 1,341 | py | Python | src/structurizr/view/branding.py | mrchrisadams/structurizr-python | a8c6958210892a13b94d5f64eb03273e7f2e398b | [
"Apache-2.0"
] | null | null | null | src/structurizr/view/branding.py | mrchrisadams/structurizr-python | a8c6958210892a13b94d5f64eb03273e7f2e398b | [
"Apache-2.0"
] | null | null | null | src/structurizr/view/branding.py | mrchrisadams/structurizr-python | a8c6958210892a13b94d5f64eb03273e7f2e398b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, Moritz E. Beber.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 23.946429 | 82 | 0.690529 |
2d6df69af4436278f908565fb12bbb5a0ed5c452 | 6,992 | py | Python | Tests/test_Consensus.py | mikepm35/biopython | 9f2d4d8d70ec7223df35fdc3d9c4a3c018756327 | [
"BSD-3-Clause"
] | 1 | 2020-02-13T14:32:44.000Z | 2020-02-13T14:32:44.000Z | Tests/test_Consensus.py | EsamTolba/biopython | 120616cf0d28cb8e581898afd6604e5a2065a137 | [
"BSD-3-Clause"
] | null | null | null | Tests/test_Consensus.py | EsamTolba/biopython | 120616cf0d28cb8e581898afd6604e5a2065a137 | [
"BSD-3-Clause"
] | 1 | 2019-03-14T18:59:30.000Z | 2019-03-14T18:59:30.000Z | # Copyright (C) 2013 by Yanbo Ye (yeyanbo289@gmail.com)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Unit tests for the Bio.Phylo.Consensus module."""
import os
import unittest
import tempfile
... | 44.535032 | 122 | 0.698227 |
2d6e0e49a92f2d6a2734b6ac5d599eedcd081e73 | 2,872 | py | Python | tests/test_tube/test_backward.py | ifsheldon/pytin | fba9e35e0ffd591610f2204c61b5c25012b30bb2 | [
"MIT"
] | 40 | 2021-07-10T01:17:04.000Z | 2022-03-24T04:10:27.000Z | tests/test_tube/test_backward.py | ifsheldon/tin | fba9e35e0ffd591610f2204c61b5c25012b30bb2 | [
"MIT"
] | 8 | 2021-12-30T19:27:09.000Z | 2022-03-21T12:44:54.000Z | tests/test_tube/test_backward.py | ifsheldon/tin | fba9e35e0ffd591610f2204c61b5c25012b30bb2 | [
"MIT"
] | 3 | 2021-07-10T15:53:24.000Z | 2022-02-10T03:14:38.000Z | import torch
import taichi as ti
from src.stannum.tube import Tube
@ti.kernel
def mul(arr: ti.template(), out: ti.template()):
for i in arr:
out[i] = arr[i] * 2.0
def test_simple_backward():
ti.init(ti.cpu)
a = torch.ones(10, requires_grad=True)
tube = Tube() \
.register_input_tenso... | 37.298701 | 110 | 0.551184 |
2d6e32166520e1389f781c81ff00515f73749ed9 | 2,616 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/update_peer_history_ttl.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/update_peer_history_ttl.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/update_peer_history_ttl.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 33.974026 | 103 | 0.620413 |
2d6e4de699a1bcebabb6b05c672b3d832b09d324 | 12,633 | py | Python | mylib/ms/evidence_regression.py | cozy9/Metascape | 261901657bef5e1060f1ae86a2a3913d1e4c87c4 | [
"Apache-2.0"
] | 2 | 2021-08-01T19:33:44.000Z | 2022-02-14T16:37:34.000Z | mylib/ms/evidence_regression.py | data2code/Metascape | 261901657bef5e1060f1ae86a2a3913d1e4c87c4 | [
"Apache-2.0"
] | null | null | null | mylib/ms/evidence_regression.py | data2code/Metascape | 261901657bef5e1060f1ae86a2a3913d1e4c87c4 | [
"Apache-2.0"
] | 1 | 2019-05-22T12:44:34.000Z | 2019-05-22T12:44:34.000Z | #!/usr/bin/env python3
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import util
import pandas as pd
import sklearn as skl
from sklearn.model_selection import StratifiedKFold
import scipy.optimize as optz
from sklearn.metrics import auc, roc_curve
#from sklearn.metrics... | 39.35514 | 201 | 0.592258 |
2d6e8a4a39410812d562472260bdf649e34c54dc | 1,177 | py | Python | oscar/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, unicode_literals
import re
from . import base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(base.Filter):
spacePreserveElements ... | 30.179487 | 91 | 0.587935 |
2d6ecea218a00bbe088775bd902937bc6570a339 | 1,250 | py | Python | stdplugins/currency.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 2 | 2019-10-23T12:30:32.000Z | 2019-10-23T20:33:26.000Z | stdplugins/currency.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 1 | 2021-02-08T20:40:44.000Z | 2021-02-08T20:40:44.000Z | stdplugins/currency.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 12 | 2019-10-25T18:48:16.000Z | 2020-04-26T11:31:21.000Z | """command: .currency usd inr"""
from telethon import events
import asyncio
from datetime import datetime
import requests
from uniborg.util import admin_cmd
@borg.on(admin_cmd(pattern="currency (.*)"))
async def _(event):
if event.fwd_from:
return
start = datetime.now()
input_str = event.pattern_m... | 35.714286 | 100 | 0.6128 |
2d6ee2ebadb5e0beb4c38fff8361701f76e8237a | 1,538 | py | Python | gpugwas/vizb.py | VibhuJawa/GPU-GWAS | 532e60a2058c17f247dfc8b914c7d4d9f8305ecb | [
"MIT"
] | null | null | null | gpugwas/vizb.py | VibhuJawa/GPU-GWAS | 532e60a2058c17f247dfc8b914c7d4d9f8305ecb | [
"MIT"
] | null | null | null | gpugwas/vizb.py | VibhuJawa/GPU-GWAS | 532e60a2058c17f247dfc8b914c7d4d9f8305ecb | [
"MIT"
] | null | null | null | #!/opt/conda/envs/rapids/bin/python
"""
Pre-reqs:
---------
/opt/conda/envs/rapids/bin/pip install bokeh
"""
import os
import cudf
import cupy
from bokeh.plotting import figure
from bokeh.io import output_notebook, push_notebook, show
output_notebook()
def show_qq_plot(df, x_axis, y_axis):
x_values = cupy.fro... | 26.517241 | 93 | 0.654746 |
2d6f08a3f2063ef9c3ee92b7c51118103d76a34a | 18,310 | py | Python | hashicorp_vault_client/hashicorp_vault_client/models/body12.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | null | null | null | hashicorp_vault_client/hashicorp_vault_client/models/body12.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | 2 | 2019-09-30T20:56:41.000Z | 2019-10-02T00:22:07.000Z | hashicorp_vault_client/hashicorp_vault_client/models/body12.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
HashiCorp Vault API
HTTP API that gives you full access to Vault. All API routes are prefixed with `/v1/`. # noqa: E501
OpenAPI spec version: 1.2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class... | 36.185771 | 369 | 0.643091 |
2d6f102d471bf54ff88dc3ac683773aedfda2a9d | 15,487 | py | Python | torchgan/models/autoencoding.py | torchgan/torchgan | f4139537ac2d3d8609d5aecc859a6fb797b107a1 | [
"MIT"
] | 1,300 | 2018-10-14T05:02:29.000Z | 2022-03-23T09:52:13.000Z | torchgan/models/autoencoding.py | yuhao20/torchgan | cfd5da4b7ffcec544c6cc4a22257edf40fd31f9d | [
"MIT"
] | 102 | 2018-10-13T22:46:03.000Z | 2022-01-03T19:20:09.000Z | torchgan/models/autoencoding.py | yuhao20/torchgan | cfd5da4b7ffcec544c6cc4a22257edf40fd31f9d | [
"MIT"
] | 164 | 2018-10-12T08:36:29.000Z | 2022-03-31T03:12:08.000Z | from math import ceil, log
import torch
import torch.nn as nn
import torch.nn.functional as F
from .model import Discriminator, Generator
__all__ = ["AutoEncodingGenerator", "AutoEncodingDiscriminator"]
class AutoEncodingGenerator(Generator):
r"""Autoencoding Generator for Boundary Equilibrium GAN (BEGAN) from... | 38.239506 | 102 | 0.489701 |
2d6f2b8c0ac957587ab3214d8717c167dd524871 | 111 | py | Python | setup.py | fno2010/first-order-cal | fc56b168815374c17559f8d86ad666601d5f60db | [
"MIT"
] | null | null | null | setup.py | fno2010/first-order-cal | fc56b168815374c17559f8d86ad666601d5f60db | [
"MIT"
] | null | null | null | setup.py | fno2010/first-order-cal | fc56b168815374c17559f8d86ad666601d5f60db | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
setup(console=["logicParser.py"])
| 18.5 | 34 | 0.675676 |
2d6f2d8c2d9cd89efdf3b2c08e2502e6e74b91be | 10,499 | py | Python | flexget/tests/test_config_schema.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | 1 | 2018-05-02T21:14:50.000Z | 2018-05-02T21:14:50.000Z | flexget/tests/test_config_schema.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | flexget/tests/test_config_schema.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from datetime import timedelta
import jsonschema
from flexget import config_schema
def iter_registered_schemas():
for path in config_schema.schema_paths:
schema =... | 36.454861 | 102 | 0.551291 |
2d6f3481fa525b431f10c7f8a3addf7c799a1f32 | 766 | py | Python | comod/models.py | Dih5/comod | 2403d104903171a20cc730c04ecf88f4aab28ac9 | [
"MIT"
] | 1 | 2021-12-17T11:51:17.000Z | 2021-12-17T11:51:17.000Z | comod/models.py | Dih5/comod | 2403d104903171a20cc730c04ecf88f4aab28ac9 | [
"MIT"
] | null | null | null | comod/models.py | Dih5/comod | 2403d104903171a20cc730c04ecf88f4aab28ac9 | [
"MIT"
] | null | null | null | from comod import Model
sir = Model("SIR",
["beta", "gamma"],
[
("S", "I", "beta I / N"),
("I", "R", "gamma")
])
sis = Model("SI",
["beta", "gamma"],
[
("S", "I", "beta I / N"),
("I", "S", "gamm... | 23.9375 | 42 | 0.248042 |
2d6f5ee80197f841a846ea1e41850c0b2a1b0bdb | 871 | py | Python | linkedlist/reversenodes.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | linkedlist/reversenodes.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | linkedlist/reversenodes.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def reverseKGroup(self, head, k):
"""
:type head: ListNode
:type k: int
:rtype: ListNode
"""
dummy = jump = ListNode(0)
... | 31.107143 | 81 | 0.475316 |
2d6f795e4afbaba4a4c69da4980fd28a93717c62 | 11,809 | py | Python | twistedcaldav/test/test_dateops.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | twistedcaldav/test/test_dateops.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | twistedcaldav/test/test_dateops.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | ##
# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 39.627517 | 144 | 0.540435 |
2d6f8a4b9ee6376e87411704ce9346595e5db6db | 5,190 | py | Python | cloudmesh/emr/openapi/cloudmesh/emr.py | cloudmesh-community/cloudmesh-emr | 9fa863a476adbb4b6539ae18d7b9cb151f65c09f | [
"Apache-2.0"
] | null | null | null | cloudmesh/emr/openapi/cloudmesh/emr.py | cloudmesh-community/cloudmesh-emr | 9fa863a476adbb4b6539ae18d7b9cb151f65c09f | [
"Apache-2.0"
] | 2 | 2019-04-26T08:22:33.000Z | 2019-04-27T00:36:46.000Z | cloudmesh/emr/openapi/cloudmesh/emr.py | cloudmesh-community/cloudmesh.emr | 9fa863a476adbb4b6539ae18d7b9cb151f65c09f | [
"Apache-2.0"
] | null | null | null | from cloudmesh.emr.api.manager import Manager
def get_list_from_arg(arg, valid):
"""
Helper function to that validates a list against a valid set.
:param arg: A string to compare against valid.
:param valid: A list of valid values.
:return: list of validated values.
"""
arg_split = arg.spl... | 30.174419 | 77 | 0.589017 |
2d6f8b4b244c8445267017c92a3f918a74765c8a | 25,654 | py | Python | cloudmesh/cm_mongo2.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | null | null | null | cloudmesh/cm_mongo2.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | 4 | 2021-06-08T20:20:08.000Z | 2022-03-11T23:30:22.000Z | cloudmesh/cm_mongo2.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from cloudmesh.config.cm_config import cm_config, cm_config_server, get_mongo_db
# from cloudmesh_base.ConfigDict import ConfigDict
from cloudmesh.iaas.eucalyptus.eucalyptus import eucalyptus
from cloudmesh.iaas.openstack.cm_compute import openstack
from cloudmesh.iaas.ec2.cm_compu... | 37.671072 | 141 | 0.540695 |
2d6fc581df22a8524d7e800e317701f0b43a827a | 2,954 | py | Python | livesync/indico_livesync/uploader.py | plourenco/indico-plugins | 4cc2e7d57a8c397684ad36e4c015672cade653cf | [
"MIT"
] | null | null | null | livesync/indico_livesync/uploader.py | plourenco/indico-plugins | 4cc2e7d57a8c397684ad36e4c015672cade653cf | [
"MIT"
] | null | null | null | livesync/indico_livesync/uploader.py | plourenco/indico-plugins | 4cc2e7d57a8c397684ad36e4c015672cade653cf | [
"MIT"
] | null | null | null | # This file is part of the Indico plugins.
# Copyright (C) 2002 - 2021 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
import re
from indico.core.db import db
from indico.util.console import verb... | 35.590361 | 115 | 0.647258 |
2d6ff56cd0e0c56ca0849e62ceb81c4100d9704e | 6,690 | py | Python | scattertext/viz/BasicHTMLFromScatterplotStructure.py | admariner/scattertext | c2ac33ce01eedf8652d9bd1d61a648751950a367 | [
"Apache-2.0"
] | 2 | 2016-07-24T20:32:18.000Z | 2016-07-26T18:54:18.000Z | scattertext/viz/BasicHTMLFromScatterplotStructure.py | JasonKessler/text-to-ideas | c2ac33ce01eedf8652d9bd1d61a648751950a367 | [
"Apache-2.0"
] | 2 | 2021-11-08T22:33:12.000Z | 2021-11-15T04:48:19.000Z | scattertext/viz/BasicHTMLFromScatterplotStructure.py | JasonKessler/text-to-ideas | c2ac33ce01eedf8652d9bd1d61a648751950a367 | [
"Apache-2.0"
] | null | null | null | import pkgutil
from typing import Tuple
from scattertext.Common import DEFAULT_D3_URL, DEFAULT_D3_SCALE_CHROMATIC, \
DEFAULT_HTML_VIZ_FILE_NAME, AUTOCOMPLETE_CSS_FILE_NAME, SEARCH_FORM_FILE_NAME
from scattertext.viz.ScatterplotStructure import InvalidProtocolException
class ExternalJSUtilts:
@staticmethod
... | 41.552795 | 144 | 0.647235 |
2d6ffa48e794014a55a8ba1994850586ad6d8c60 | 1,126 | py | Python | anfinrud_auxiliary/tests/test_traveling_salesman.py | vstadnytskyi/anfinrud_auxiliary | bd67c9bac12e67c3b25857866ffbc1a500fc80a7 | [
"BSD-3-Clause"
] | null | null | null | anfinrud_auxiliary/tests/test_traveling_salesman.py | vstadnytskyi/anfinrud_auxiliary | bd67c9bac12e67c3b25857866ffbc1a500fc80a7 | [
"BSD-3-Clause"
] | null | null | null | anfinrud_auxiliary/tests/test_traveling_salesman.py | vstadnytskyi/anfinrud_auxiliary | bd67c9bac12e67c3b25857866ffbc1a500fc80a7 | [
"BSD-3-Clause"
] | null | null | null | from numpy import zeros, array_equal
from anfinrud_auxiliary import traveling_salesman as ts
def test_euclidian_distance():
x = (1,2,3)
y = (2,3,4)
assert (ts.euclidean_distance(x,y) == 3**0.5)
x = (1,2,3)
y = (2,4,4)
assert (ts.euclidean_distance(x,y) == (1**2+2**2+1**2)**0.5)
def test_creat... | 30.432432 | 72 | 0.554174 |
2d7046110325eafa0c9c97e1fece40687d8a5840 | 27,663 | py | Python | sfepy/parallel/parallel.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | null | null | null | sfepy/parallel/parallel.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | null | null | null | sfepy/parallel/parallel.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | null | null | null | """
Functions for a high-level PETSc-based parallelization.
"""
from __future__ import absolute_import
import time
import os
import numpy as nm
from six.moves import range
def init_petsc_args():
try:
import sys, petsc4py
except ImportError:
return
argv = [arg for arg in sys.argv if arg n... | 33.328916 | 80 | 0.595091 |
2d706217ef2ba42b0f91f2aa5c93e395982d4bdc | 2,561 | py | Python | library_setup.py | gravic07/the_library | b40a0e4c0736093700eaf1bcf305151011813482 | [
"MIT"
] | null | null | null | library_setup.py | gravic07/the_library | b40a0e4c0736093700eaf1bcf305151011813482 | [
"MIT"
] | null | null | null | library_setup.py | gravic07/the_library | b40a0e4c0736093700eaf1bcf305151011813482 | [
"MIT"
] | null | null | null | # The Library v1.0.0
# Grant Vickers - https://github.com/gravic07
from sqlalchemy import (
Column, ForeignKey, Integer, String
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()
# Table of all Patro... | 34.146667 | 141 | 0.671613 |
2d70691e5ab8112a143f16fea6334041927ecd3a | 7,448 | py | Python | Lib/test/test_importlib/source/test_finder.py | bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | [
"PSF-2.0"
] | 164 | 2015-01-04T07:04:07.000Z | 2022-01-06T03:18:56.000Z | Lib/test/test_importlib/source/test_finder.py | bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | [
"PSF-2.0"
] | 3 | 2015-08-27T07:35:26.000Z | 2016-04-07T16:35:39.000Z | Lib/test/test_importlib/source/test_finder.py | bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | [
"PSF-2.0"
] | 35 | 2015-06-11T05:35:55.000Z | 2022-01-11T19:32:00.000Z | from .. import abc
from . import util as source_util
from importlib import machinery
import errno
import os
import py_compile
import stat
import sys
import tempfile
from test.support import make_legacy_pyc
import unittest
import warnings
class FinderTests(abc.FinderTests):
"""For a top-level module, it should j... | 38.994764 | 80 | 0.627551 |
2d70b14a81a2711db954beef9e19867bba6c871d | 4,207 | py | Python | Test.py | jonaschianu/Self-Driving-Car | 053e2fd5cf945809249255071a45b6894b32a4c3 | [
"MIT"
] | null | null | null | Test.py | jonaschianu/Self-Driving-Car | 053e2fd5cf945809249255071a45b6894b32a4c3 | [
"MIT"
] | null | null | null | Test.py | jonaschianu/Self-Driving-Car | 053e2fd5cf945809249255071a45b6894b32a4c3 | [
"MIT"
] | null | null | null | """**************************************************************************************
* Project: Longitude & Lateral controllers for Waypoint tracking of vehicle *
* *
* Files: Test.py ... | 45.728261 | 94 | 0.347991 |
2d70b4dc7bc2fc9c35070de5977e7bcaeef50f2b | 3,389 | py | Python | nova/tests/functional/api_sample_tests/test_networks.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/api_sample_tests/test_networks.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/api_sample_tests/test_networks.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 1 | 2020-03-01T17:04:57.000Z | 2020-03-01T17:04:57.000Z | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | 42.898734 | 79 | 0.672175 |
2d70b6e404c33ca5ff9fb29c13ae53eecc6b6e60 | 3,298 | py | Python | toontown/cogdominium/DistCogdoCraneMoneyBag.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/cogdominium/DistCogdoCraneMoneyBag.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/cogdominium/DistCogdoCraneMoneyBag.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from panda3d.core import *
from panda3d.direct import *
from direct.interval.IntervalGlobal import *
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from otp.otpbase import OTPGlobals
from toontown.cogdominium.DistCogdoCraneObject import DistCogdoCraneObject
from toontow... | 37.05618 | 265 | 0.708914 |
2d70bb890092bcb3946cde77e5bdb1c6ddde3348 | 806 | py | Python | demos/oneliners.py | ThomasTNO/mpyc | 11ea79be06a676a8b2ae2d81d94621ec35c638e8 | [
"MIT"
] | null | null | null | demos/oneliners.py | ThomasTNO/mpyc | 11ea79be06a676a8b2ae2d81d94621ec35c638e8 | [
"MIT"
] | null | null | null | demos/oneliners.py | ThomasTNO/mpyc | 11ea79be06a676a8b2ae2d81d94621ec35c638e8 | [
"MIT"
] | null | null | null | """Couple of MPyC oneliners.
Run with m parties to compute:
- m = sum_{i=0}^{m-1} 1 = sum(1 for i in range(m))
- m**2 = sum_{i=0}^{m-1} 2i+1 = sum(2*i+1 for i in range(m))
- 2**m = prod_{i=0}^{m-1} 2 = prod(2 for i in range(m))
- m! = prod_{i=0}^{m-1} i+1 = prod(i+1 for i in range(m))
B... | 38.380952 | 88 | 0.596774 |
2d70c79dbfd6d33008c5173cf2e94fd23eefd03d | 3,555 | py | Python | lib/reda/utils/geometric_factors.py | j-hase/reda | b6419c39842cfbdd9380a27a5c6e9a04ccaeb294 | [
"MIT"
] | 12 | 2017-12-11T08:32:46.000Z | 2021-06-09T05:41:57.000Z | lib/reda/utils/geometric_factors.py | j-hase/reda | b6419c39842cfbdd9380a27a5c6e9a04ccaeb294 | [
"MIT"
] | 58 | 2017-11-12T11:10:42.000Z | 2021-06-11T13:52:44.000Z | lib/reda/utils/geometric_factors.py | geophysics-ubonn/REDA | 8f0399031121f5a937171231a25f9ab03a3c8873 | [
"MIT"
] | 11 | 2017-11-12T12:02:35.000Z | 2021-02-16T06:54:04.000Z | """
select and execute functions to compute geometric factors according to the
rcParams variable.
"""
import os
import pandas as pd
import numpy as np
import reda
def apply_K(df, k, **kwargs):
"""Apply the geometric factors to the dataset and compute (apparent)
resistivities/conductivities
Parameters
... | 27.773438 | 79 | 0.60647 |
2d70c9e166d10d8d1f65be1db047ef7b8cc8a7a5 | 164 | py | Python | scattertext/viz/__init__.py | tigerneil/scattertext | 23351895ada347fae300bf910c2c77f47ac58a35 | [
"Apache-2.0"
] | 1 | 2020-08-11T03:27:28.000Z | 2020-08-11T03:27:28.000Z | scattertext/viz/__init__.py | tigerneil/scattertext | 23351895ada347fae300bf910c2c77f47ac58a35 | [
"Apache-2.0"
] | null | null | null | scattertext/viz/__init__.py | tigerneil/scattertext | 23351895ada347fae300bf910c2c77f47ac58a35 | [
"Apache-2.0"
] | 1 | 2020-01-08T00:25:31.000Z | 2020-01-08T00:25:31.000Z | from .HTMLVisualizationAssembly import HTMLVisualizationAssembly
from .VizDataAdapter import VizDataAdapter
from .HTMLSemioticSquareViz import HTMLSemioticSquareViz | 54.666667 | 64 | 0.914634 |
2d70e728ff8e2502d781eee7cb1cb79ea17ddf17 | 10,161 | py | Python | venv/lib/python3.8/site-packages/xdis/disasm.py | yuta-komura/vishnu | 67173b674d5f4f3be189474103612447ef69ab44 | [
"MIT"
] | 1 | 2021-05-20T19:33:37.000Z | 2021-05-20T19:33:37.000Z | S4/S4 Decompiler/xdis/disasm.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | 4 | 2020-10-03T20:37:55.000Z | 2020-10-04T23:11:38.000Z | S4/S4 Decompiler/xdis/disasm.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | # Copyright (c) 2016-2018, 2020 by Rocky Bernstein
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This progr... | 30.331343 | 101 | 0.614014 |
2d70e791d3f5bd4b2b556076490b6e1b3e279fc3 | 7,105 | py | Python | Selenium_PhantomJS/source/pyaml/__init__.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 1 | 2019-06-27T12:09:44.000Z | 2019-06-27T12:09:44.000Z | Selenium_PhantomJS/source/pyaml/__init__.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | Selenium_PhantomJS/source/pyaml/__init__.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import itertools as it, operator as op, functools as ft
from collections import defaultdict, OrderedDict, namedtuple
import os, sys, io, yaml
if sys.version_info.major > 2: unicode = str
class PrettyYAMLDumper(yaml.dumper.SafeDumper):
... | 37.792553 | 94 | 0.730471 |
2d7104095f0239c57ca1739396a244b7e7918e83 | 19,934 | py | Python | canvas_course_site_wizard/models.py | Harvard-University-iCommons/django-canvas-course-site-wizard | 0210849e959407e5a850188f50756eb69b9a4dc2 | [
"MIT"
] | null | null | null | canvas_course_site_wizard/models.py | Harvard-University-iCommons/django-canvas-course-site-wizard | 0210849e959407e5a850188f50756eb69b9a4dc2 | [
"MIT"
] | 5 | 2018-05-10T19:49:43.000Z | 2021-01-29T19:39:34.000Z | canvas_course_site_wizard/models.py | Harvard-University-iCommons/django-canvas-course-site-wizard | 0210849e959407e5a850188f50756eb69b9a4dc2 | [
"MIT"
] | null | null | null | import logging
import time
from datetime import datetime, timedelta
from django.db.models import Q
from icommons_common.models import CourseInstance, CourseSite, SiteMap, SiteMapType
from django.conf import settings
from django.db import models
logger = logging.getLogger(__name__)
class SISCourseDataMixin(object):... | 39.630219 | 125 | 0.665145 |
2d711dcb230d1e254b9760ff6a44ae0876d296dd | 9,877 | py | Python | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_policy/_parser.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_policy/_parser.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_policy/_parser.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 OpenStack Foundation.
# 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... | 28.964809 | 79 | 0.607067 |
2d7122a8b1ea5ef68c3a104b1ab32649c459560e | 1,572 | py | Python | python/tests/test_vertex.py | leonoverweel/graph-coloring | 48654a2e4cb3ddd786ac6193f9d73271c43eabf0 | [
"MIT"
] | null | null | null | python/tests/test_vertex.py | leonoverweel/graph-coloring | 48654a2e4cb3ddd786ac6193f9d73271c43eabf0 | [
"MIT"
] | null | null | null | python/tests/test_vertex.py | leonoverweel/graph-coloring | 48654a2e4cb3ddd786ac6193f9d73271c43eabf0 | [
"MIT"
] | null | null | null | import unittest
from models.vertex import Vertex
class TestVertex(unittest.TestCase):
def test___init__(self):
vertex0 = Vertex()
self.assertIsInstance(vertex0, Vertex)
self.assertEquals([], vertex0.adjacent_to)
self.assertEquals(None, vertex0.data)
vertex1 = ... | 33.446809 | 68 | 0.605598 |
2d7127ce19465a25075989e0c5777f0108be09e3 | 19,259 | py | Python | vnpy/app/portfolio_strategy/engine.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | 323 | 2015-11-21T14:45:29.000Z | 2022-03-16T08:54:37.000Z | vnpy/app/portfolio_strategy/engine.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | 9 | 2017-03-21T08:26:21.000Z | 2021-08-23T06:41:17.000Z | vnpy/app/portfolio_strategy/engine.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | 148 | 2016-09-26T03:25:39.000Z | 2022-02-06T14:43:48.000Z | """"""
import importlib
import os
import traceback
from collections import defaultdict
from pathlib import Path
from typing import Dict, List, Set, Tuple, Type, Any, Callable
from datetime import datetime, timedelta
from concurrent.futures import ThreadPoolExecutor
from vnpy.event import Event, EventEngine
from vnpy.... | 30.8144 | 119 | 0.606158 |
2d713c520fa40aa954dbd81e65910c986fc1f21b | 2,844 | py | Python | heapdict.py | banjjak0214/Data-Visualization-Trajectory | 543940e8c703567cfc8043359141d762bf0d2c76 | [
"MIT"
] | 1 | 2020-05-07T23:25:24.000Z | 2020-05-07T23:25:24.000Z | heapdict.py | belopot/Data-Visualization-Trajectory | 543940e8c703567cfc8043359141d762bf0d2c76 | [
"MIT"
] | null | null | null | heapdict.py | belopot/Data-Visualization-Trajectory | 543940e8c703567cfc8043359141d762bf0d2c76 | [
"MIT"
] | null | null | null | import collections
def doc(s):
if hasattr(s, '__call__'):
s = s.__doc__
def f(g):
g.__doc__ = s
return g
return f
class heapdict(collections.MutableMapping):
__marker = object()
@staticmethod
def _parent(i):
return ((i - 1) >> 1)
@staticmethod
def _... | 24.517241 | 130 | 0.516526 |
2d715fe35ee2abfc671eefdb15584632a564cf57 | 18,754 | py | Python | config-docBiRNN-vis-new.py | shuokabe/deepQuest-mod | 7140a57c30deedb0570bc835c6ad3c848f0039f4 | [
"BSD-3-Clause"
] | null | null | null | config-docBiRNN-vis-new.py | shuokabe/deepQuest-mod | 7140a57c30deedb0570bc835c6ad3c848f0039f4 | [
"BSD-3-Clause"
] | null | null | null | config-docBiRNN-vis-new.py | shuokabe/deepQuest-mod | 7140a57c30deedb0570bc835c6ad3c848f0039f4 | [
"BSD-3-Clause"
] | null | null | null | def load_parameters():
"""
Loads the defined hyperparameters
:return parameters: Dictionary of loaded parameters
"""
# Input data params
TASK_NAME = 'doc-level' # Task name
DATASET_NAME = TASK_NAME # Dataset name
SRC_LAN = 'en' ... | 64.446735 | 175 | 0.570278 |
2d7162221dd0a4cb3946ef877905a238c08deb05 | 886 | py | Python | app/__init__.py | ebenolson/annot | ea05a69cd84834b7b1ea2d9bbb9472266af0ce73 | [
"MIT"
] | null | null | null | app/__init__.py | ebenolson/annot | ea05a69cd84834b7b1ea2d9bbb9472266af0ce73 | [
"MIT"
] | null | null | null | app/__init__.py | ebenolson/annot | ea05a69cd84834b7b1ea2d9bbb9472266af0ce73 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
from flask_restful import Api
from flask.ext.bower import Bower
from .views import filelist
from .views import classmap
from .resources.files import image
from .resources.files import label
app = Flask(__name__)
Bower(app)
api = Api(app)
api.add_resource(image,
... | 21.095238 | 55 | 0.68623 |
2d716572eab9d59b9fdebb73c3121b58d770ce85 | 551 | py | Python | violas_client/lbrtypes/account_config/events/new_epoch.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/lbrtypes/account_config/events/new_epoch.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/lbrtypes/account_config/events/new_epoch.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | 1 | 2022-01-05T06:49:42.000Z | 2022-01-05T06:49:42.000Z | from violas_client.canoser import Struct, Uint64
from violas_client.move_core_types.account_address import AccountAddress
from violas_client.move_core_types.move_resource import MoveResource
from violas_client.lbrtypes.on_chain_config import new_epoch_event_key
class NewEpochEvent(Struct, MoveResource):
MODULE_NAM... | 30.611111 | 72 | 0.76225 |
2d717880cd480879e42a3d68358f4c8b39f9ea74 | 1,581 | py | Python | finley/test/python/run_linearPDEsOnFinley1_3D2_part2.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | null | null | null | finley/test/python/run_linearPDEsOnFinley1_3D2_part2.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | 1 | 2019-01-14T03:07:43.000Z | 2019-01-14T03:07:43.000Z | finley/test/python/run_linearPDEsOnFinley1_3D2_part2.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | null | null | null |
########################################################
#
# Copyright (c) 2003-2018 by The University of Queensland
# Earth Systems Science Computational Center (ESSCC)
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/... | 29.830189 | 73 | 0.673624 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.