hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1db4c6bb2d063343a5a39078ad82906e428ed0 | 52,124 | py | Python | tensorflow/python/keras/optimizer_v2/optimizer_v2.py | drezap/tensorflow | df6853ac5b6dbeefa814e67041fc4744c1528629 | [
"Apache-2.0"
] | 2 | 2020-02-20T15:42:41.000Z | 2020-03-06T09:38:56.000Z | tensorflow/python/keras/optimizer_v2/optimizer_v2.py | drezap/tensorflow | df6853ac5b6dbeefa814e67041fc4744c1528629 | [
"Apache-2.0"
] | 2 | 2021-08-25T16:09:48.000Z | 2022-02-10T02:18:35.000Z | tensorflow/python/keras/optimizer_v2/optimizer_v2.py | Chiranjeevi731/Machine-Learning | 0ec3c78e0a34f224ee041b54a24717f77d3246fa | [
"Apache-2.0"
] | 1 | 2021-09-19T10:06:21.000Z | 2021-09-19T10:06:21.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.428139 | 101 | 0.695822 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import functools
import six
from tensorflow.python.distribute import distribution_strategy_context as distribute_ctx
from tensorflow.python.distribute import parameter_server_strate... | true | true |
1c1db4ce1e32d9950ff1d22e3c59eed9129a4793 | 4,066 | py | Python | src/models.py | coosoti/ret-trip | cc689877131fe8e1c820827ceae72c878be4f4b6 | [
"MIT"
] | null | null | null | src/models.py | coosoti/ret-trip | cc689877131fe8e1c820827ceae72c878be4f4b6 | [
"MIT"
] | null | null | null | src/models.py | coosoti/ret-trip | cc689877131fe8e1c820827ceae72c878be4f4b6 | [
"MIT"
] | null | null | null | import uuid
from django.db import DefaultConnectionProxy, models
from django.contrib.auth.models import User
from django.db.models.fields.related import ForeignKey
from django.utils import timezone
class Customer(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
avatar = models.ImageF... | 38.358491 | 97 | 0.725529 | import uuid
from django.db import DefaultConnectionProxy, models
from django.contrib.auth.models import User
from django.db.models.fields.related import ForeignKey
from django.utils import timezone
class Customer(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
avatar = models.ImageF... | true | true |
1c1db4f9043948eca2126487891749752db38235 | 12,848 | py | Python | YOLO/.history/pytorch-yolo-v3/video_demo_v1_20201106003651.py | jphacks/D_2003 | 60a5684d549862e85bdf758069518702d9925a48 | [
"MIT"
] | 1 | 2020-11-07T07:58:13.000Z | 2020-11-07T07:58:13.000Z | YOLO/.history/pytorch-yolo-v3/video_demo_v1_20201106003651.py | jphacks/D_2003 | 60a5684d549862e85bdf758069518702d9925a48 | [
"MIT"
] | null | null | null | YOLO/.history/pytorch-yolo-v3/video_demo_v1_20201106003651.py | jphacks/D_2003 | 60a5684d549862e85bdf758069518702d9925a48 | [
"MIT"
] | 4 | 2020-11-02T02:51:45.000Z | 2020-11-07T02:54:47.000Z | from __future__ import division
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import cv2
from util import *
from darknet import Darknet
from preprocess import prep_image, inp_to_image
import pandas as pd
import random
import argparse
import pickle as pkl
import r... | 33.810526 | 126 | 0.533935 | from __future__ import division
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import cv2
from util import *
from darknet import Darknet
from preprocess import prep_image, inp_to_image
import pandas as pd
import random
import argparse
import pickle as pkl
import r... | true | true |
1c1db53fc40ce2b2094d5b9add034414f2fa14c8 | 6,693 | py | Python | bindings/python/ensmallen_graph/datasets/string/kytococcussedentarius.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/kytococcussedentarius.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/kytococcussedentarius.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Kytococcus sedentarius.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021... | 35.412698 | 223 | 0.704019 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def KytococcusSedentarius(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
... | true | true |
1c1db55e12f321add32a21282494f5ce1ceda4fa | 946 | py | Python | var/spack/repos/builtin/packages/py-aiodns/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-aiodns/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/py-aiodns/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyAiodns(PythonPackage):
"""Simple DNS resolver for asyncio.It provides a simple w... | 41.130435 | 95 | 0.738901 |
from spack.package import *
class PyAiodns(PythonPackage):
homepage = "https://pypi.org/project/aiodns/"
pypi = "aiodns/aiodns-2.0.0.tar.gz"
version('2.0.0', sha256='815fdef4607474295d68da46978a54481dd1e7be153c7d60f9e72773cd38d77d')
version('1.2.0', sha256='d67e14b32176bcf3ff79b5d47c466011c... | true | true |
1c1db81da6c906d816776f3192c13205eac6c1f4 | 483 | py | Python | mainapp/admin.py | ploggingdev/finitecoins | 60f69cc563e1a26be8c659d4400579025219a223 | [
"MIT"
] | null | null | null | mainapp/admin.py | ploggingdev/finitecoins | 60f69cc563e1a26be8c659d4400579025219a223 | [
"MIT"
] | 5 | 2020-02-11T23:31:23.000Z | 2021-06-10T21:03:24.000Z | mainapp/admin.py | ploggingdev/finitecoins | 60f69cc563e1a26be8c659d4400579025219a223 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Game, StaticResource
from .forms import AdminGameForm, AdminStaticResourceForm
from reversion.admin import VersionAdmin
@admin.register(Game)
class GameAdmin(VersionAdmin):
form = AdminGameForm
list_display = ('name', 'user', 'public', 'deleted','created')
... | 34.5 | 66 | 0.770186 | from django.contrib import admin
from .models import Game, StaticResource
from .forms import AdminGameForm, AdminStaticResourceForm
from reversion.admin import VersionAdmin
@admin.register(Game)
class GameAdmin(VersionAdmin):
form = AdminGameForm
list_display = ('name', 'user', 'public', 'deleted','created')
... | true | true |
1c1db88721cb115369db4004458c4675b53740a0 | 3,902 | py | Python | localcache.py | ahills60/python-local-cache | dea36d2ed2184d08100889ef11a2ccc40e214fdd | [
"MIT"
] | null | null | null | localcache.py | ahills60/python-local-cache | dea36d2ed2184d08100889ef11a2ccc40e214fdd | [
"MIT"
] | null | null | null | localcache.py | ahills60/python-local-cache | dea36d2ed2184d08100889ef11a2ccc40e214fdd | [
"MIT"
] | null | null | null | import os, gzip, pickle, hashlib, shutil, itertools
class localcache:
"""
Local cache class for managing a local cache of files
Author: Andrew Hills (a.hills@sheffield.ac.uk)
Data: 2019-02-07
"""
def __init__(self, verbose = False):
"""
Local Cache initialisation.
"""
... | 33.930435 | 134 | 0.596873 | import os, gzip, pickle, hashlib, shutil, itertools
class localcache:
def __init__(self, verbose = False):
self._sourceList = []
def _verb(self, message = ""):
print("{}: {}".format(self.__class__, message))
def add_source(self, datasource = None):
if datasource is N... | true | true |
1c1dba17106b001de437f88487bb6151f5f38f7a | 31,020 | py | Python | cli_sample/ptyprocess/ptyprocess.py | nathanwiens/sdk-samples | 3c2eb81a94d9135643ce19a24c78b2d1e23c4461 | [
"Unlicense"
] | 44 | 2016-06-14T23:28:13.000Z | 2022-03-09T00:48:53.000Z | cli_sample/ptyprocess/ptyprocess.py | nathanwiens/sdk-samples | 3c2eb81a94d9135643ce19a24c78b2d1e23c4461 | [
"Unlicense"
] | 11 | 2017-06-14T17:02:54.000Z | 2022-02-23T02:54:00.000Z | cli_sample/ptyprocess/ptyprocess.py | nathanwiens/sdk-samples | 3c2eb81a94d9135643ce19a24c78b2d1e23c4461 | [
"Unlicense"
] | 44 | 2016-10-19T15:45:03.000Z | 2022-03-24T15:38:04.000Z | import codecs
import errno
import fcntl
import io
import os
import pty
# davep 20170513 ; no resource module in firmware so hack it
#import resource
import signal
import struct
import sys
import termios
import time
try:
import builtins # Python 3
except ImportError:
import __builtin__ as builtins # Python 2... | 37.194245 | 83 | 0.581915 | import codecs
import errno
import fcntl
import io
import os
import pty
import signal
import struct
import sys
import termios
import time
try:
import builtins
except ImportError:
import __builtin__ as builtins
from pty import (STDIN_FILENO, CHILD)
from .util import which
_platform = sys.platform.lower... | true | true |
1c1dbd57f0cd87199f7d756cf203fac463924136 | 130 | py | Python | OSTL/08 Fib.py | pratikpc/OpenGL-Pracs | 8827eb65576db788733a011dcabee4daa3d32d94 | [
"MIT"
] | 1 | 2019-04-26T15:09:57.000Z | 2019-04-26T15:09:57.000Z | OSTL/08 Fib.py | pratikpc/OpenGL-Pracs | 8827eb65576db788733a011dcabee4daa3d32d94 | [
"MIT"
] | null | null | null | OSTL/08 Fib.py | pratikpc/OpenGL-Pracs | 8827eb65576db788733a011dcabee4daa3d32d94 | [
"MIT"
] | 1 | 2020-11-19T07:59:13.000Z | 2020-11-19T07:59:13.000Z | def Fib(n):
if n == 0 or n == 1:
return n;
return Fib(n-1) + Fib(n-2);
for i in range(5):
print ("Fib is ", Fib(i)); | 18.571429 | 30 | 0.492308 | def Fib(n):
if n == 0 or n == 1:
return n;
return Fib(n-1) + Fib(n-2);
for i in range(5):
print ("Fib is ", Fib(i)); | true | true |
1c1dbdfffddf6ec820945da74d1be2b179883308 | 73 | py | Python | T26-03/program.py | tiagomendes7/SSof-Project1920 | 9b026763a492683ab982aa769f2a381ed02930aa | [
"MIT"
] | 2 | 2019-11-20T19:26:07.000Z | 2019-11-22T00:42:23.000Z | T26-03/program.py | tiagomendes7/SSof-Project1920 | 9b026763a492683ab982aa769f2a381ed02930aa | [
"MIT"
] | 2 | 2019-11-28T05:21:24.000Z | 2019-11-28T05:21:58.000Z | T26-03/program.py | tiagomendes7/SSof-Project1920 | 9b026763a492683ab982aa769f2a381ed02930aa | [
"MIT"
] | 25 | 2019-11-27T01:40:56.000Z | 2019-12-04T23:38:59.000Z | src = source()
src2 = src
src3 = src2
src5 = src2
src4 = src3
sink(src4)
| 10.428571 | 14 | 0.657534 | src = source()
src2 = src
src3 = src2
src5 = src2
src4 = src3
sink(src4)
| true | true |
1c1dbeba78cff1920209c72833814bb02556b329 | 24 | py | Python | version.py | DavidM42/SonaWrap | c1e46e680856135b15d0ebd4b75cdf93a9e69802 | [
"MIT"
] | null | null | null | version.py | DavidM42/SonaWrap | c1e46e680856135b15d0ebd4b75cdf93a9e69802 | [
"MIT"
] | null | null | null | version.py | DavidM42/SonaWrap | c1e46e680856135b15d0ebd4b75cdf93a9e69802 | [
"MIT"
] | null | null | null | version_number = "0.0.3" | 24 | 24 | 0.708333 | version_number = "0.0.3" | true | true |
1c1dbf27165e7dfd3afd2bc8fd72db1fb66be84e | 3,511 | py | Python | bindings/python/ensmallen/datasets/string/paraburkholderiaribeironis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/paraburkholderiaribeironis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/paraburkholderiaribeironis.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Paraburkholderia ribeironis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--pr... | 33.438095 | 223 | 0.681287 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def ParaburkholderiaRibeironis(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graph... | true | true |
1c1dbfbdf19b88dc805d06f0376f9b9a3d1a5bad | 256 | py | Python | configs/faster_rcnn/faster_rcnn_r50_fpn_multirois_1x_coco.py | Fanzhongjie/ARFE | 4b96b8c5bc0895d3d30acec2a490f81a860fe860 | [
"Apache-2.0"
] | null | null | null | configs/faster_rcnn/faster_rcnn_r50_fpn_multirois_1x_coco.py | Fanzhongjie/ARFE | 4b96b8c5bc0895d3d30acec2a490f81a860fe860 | [
"Apache-2.0"
] | null | null | null | configs/faster_rcnn/faster_rcnn_r50_fpn_multirois_1x_coco.py | Fanzhongjie/ARFE | 4b96b8c5bc0895d3d30acec2a490f81a860fe860 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/models/faster_rcnn_r50_fpn.py',
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
# resume_from='./work_dirs/faster_rcnn_r50_fpn_multirois_1x_coco/epoch_11.pth' | 36.571429 | 78 | 0.734375 | _base_ = [
'../_base_/models/faster_rcnn_r50_fpn.py',
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
| true | true |
1c1dc11c579b236ee029b61ce5590e1b1d238476 | 173 | py | Python | dropbox_app/__init__.py | manish001in/custom-zapier-cli | 00fe865b0ad0d06d4a18388011a1b1ff9f2c72a2 | [
"MIT"
] | null | null | null | dropbox_app/__init__.py | manish001in/custom-zapier-cli | 00fe865b0ad0d06d4a18388011a1b1ff9f2c72a2 | [
"MIT"
] | null | null | null | dropbox_app/__init__.py | manish001in/custom-zapier-cli | 00fe865b0ad0d06d4a18388011a1b1ff9f2c72a2 | [
"MIT"
] | null | null | null | from django.conf import settings
import os
DOWNLOADS_DIR = settings.BASE_DIR+'/downloads/dropbox_app/'
if not os.path.exists(DOWNLOADS_DIR):
os.makedirs(DOWNLOADS_DIR) | 24.714286 | 59 | 0.797688 | from django.conf import settings
import os
DOWNLOADS_DIR = settings.BASE_DIR+'/downloads/dropbox_app/'
if not os.path.exists(DOWNLOADS_DIR):
os.makedirs(DOWNLOADS_DIR) | true | true |
1c1dc1fa63b2b746a82ed0ce5c9528f636ed5d27 | 813 | py | Python | day7/main.py | AXVin/aoc2021 | 6c9dfb95bb3cf315705b7758979908a3ad98c1e1 | [
"MIT"
] | null | null | null | day7/main.py | AXVin/aoc2021 | 6c9dfb95bb3cf315705b7758979908a3ad98c1e1 | [
"MIT"
] | null | null | null | day7/main.py | AXVin/aoc2021 | 6c9dfb95bb3cf315705b7758979908a3ad98c1e1 | [
"MIT"
] | 1 | 2021-12-09T06:37:46.000Z | 2021-12-09T06:37:46.000Z |
from utils import *
with open("input.txt", "r") as file:
data = file.read()
@test(37)
def part1(data):
data = data.split(",")
data = list(map(int, data))
fuels = []
for i in range(min(data), max(data)):
fuel_used = sum(abs(crab - i) for crab in data)
fuels.append(fuel_used)
r... | 25.40625 | 83 | 0.571956 |
from utils import *
with open("input.txt", "r") as file:
data = file.read()
@test(37)
def part1(data):
data = data.split(",")
data = list(map(int, data))
fuels = []
for i in range(min(data), max(data)):
fuel_used = sum(abs(crab - i) for crab in data)
fuels.append(fuel_used)
r... | true | true |
1c1dc257892e4c73cbabf953e50247b85e5fd396 | 15,930 | py | Python | Yukki/Plugins/song.py | GigsXerxes/levinaold | 5c5b1dc43b25514e6d8a225bc4b7ba5efd1e4174 | [
"MIT"
] | null | null | null | Yukki/Plugins/song.py | GigsXerxes/levinaold | 5c5b1dc43b25514e6d8a225bc4b7ba5efd1e4174 | [
"MIT"
] | null | null | null | Yukki/Plugins/song.py | GigsXerxes/levinaold | 5c5b1dc43b25514e6d8a225bc4b7ba5efd1e4174 | [
"MIT"
] | null | null | null | import os
import time
from os import path
import random
import asyncio
import shutil
from pytube import YouTube
from yt_dlp import YoutubeDL
from .. import converter
import yt_dlp
import shutil
import psutil
from pyrogram import Client
from pyrogram.types import Message
from pyrogram.types import Voice
from sys import ... | 53.1 | 789 | 0.621532 | import os
import time
from os import path
import random
import asyncio
import shutil
from pytube import YouTube
from yt_dlp import YoutubeDL
from .. import converter
import yt_dlp
import shutil
import psutil
from pyrogram import Client
from pyrogram.types import Message
from pyrogram.types import Voice
from sys import ... | true | true |
1c1dc2d47a943d4998defe5c93c6f27d1cfff5ed | 2,651 | py | Python | src/basket_case/__init__.py | beaucronin/basket_case | 27c131296233c0b9337d61a856071c7e9185081a | [
"MIT"
] | null | null | null | src/basket_case/__init__.py | beaucronin/basket_case | 27c131296233c0b9337d61a856071c7e9185081a | [
"MIT"
] | null | null | null | src/basket_case/__init__.py | beaucronin/basket_case | 27c131296233c0b9337d61a856071c7e9185081a | [
"MIT"
] | null | null | null | from typing import List, Optional, Tuple
from titlecase import titlecase as _titlecase
from slugify import slugify as _slugify
from copy import copy
def canonical(s: str) -> str:
return s.lower()
def camel(s: str, delims=" _-", capitalize_first=False) -> str:
ops = [(uppercase_after, d) for d in delims]
... | 21.552846 | 76 | 0.566579 | from typing import List, Optional, Tuple
from titlecase import titlecase as _titlecase
from slugify import slugify as _slugify
from copy import copy
def canonical(s: str) -> str:
return s.lower()
def camel(s: str, delims=" _-", capitalize_first=False) -> str:
ops = [(uppercase_after, d) for d in delims]
... | true | true |
1c1dc3252b95ce62435665207dbea67b3d88c64a | 51 | py | Python | docs/practicums/practicum1/question1/ml_deploy_demo/models/neural_networks.py | hopesummer/2020-AC295 | 6464dcb5b37a2c2e858fb6f76835aa608f2dae7f | [
"MIT"
] | 5 | 2020-03-27T00:22:43.000Z | 2020-09-06T20:23:30.000Z | docs/practicums/practicum1/question1/ml_deploy_demo/models/neural_networks.py | hopesummer/2020-AC295 | 6464dcb5b37a2c2e858fb6f76835aa608f2dae7f | [
"MIT"
] | null | null | null | docs/practicums/practicum1/question1/ml_deploy_demo/models/neural_networks.py | hopesummer/2020-AC295 | 6464dcb5b37a2c2e858fb6f76835aa608f2dae7f | [
"MIT"
] | 9 | 2020-02-18T22:17:17.000Z | 2021-01-28T17:09:46.000Z | """
Define your own Neural Network model here.
"""
| 12.75 | 42 | 0.686275 | true | true | |
1c1dc3c9250fa05f6780920d28876b27e7d94eca | 3,330 | py | Python | konker.samples/smart-temperature/dao/pid.py | sonecabr/konker-platform | 12f6307cb5125ab58788972957e1e6fee29ff0c4 | [
"Apache-2.0"
] | 34 | 2017-02-06T12:31:29.000Z | 2021-11-03T18:39:50.000Z | konker.samples/smart-temperature/dao/pid.py | rzarref/konker-platform | 4485490b41bf4db34a0e919c5863a9cc3dff3504 | [
"Apache-2.0"
] | 15 | 2017-02-07T12:10:00.000Z | 2021-11-10T13:28:45.000Z | konker.samples/smart-temperature/dao/pid.py | rzarref/konker-platform | 4485490b41bf4db34a0e919c5863a9cc3dff3504 | [
"Apache-2.0"
] | 11 | 2017-02-16T08:50:03.000Z | 2021-06-22T23:57:45.000Z | import sqlite3
from dao.transaction import *
from config import *
class PidDao:
SCHEMA = """
CREATE TABLE IF NOT EXISTS pid_params (
ID INTEGER PRIMARY KEY AUTOINCREMENT,
DEVICE_KEY TEXT NOT NULL,
KP REAL NOT NULL DEFAULT 0.0,
KI REAL NOT NULL DEFAULT 0.0,
... | 30.272727 | 90 | 0.517417 | import sqlite3
from dao.transaction import *
from config import *
class PidDao:
SCHEMA = """
CREATE TABLE IF NOT EXISTS pid_params (
ID INTEGER PRIMARY KEY AUTOINCREMENT,
DEVICE_KEY TEXT NOT NULL,
KP REAL NOT NULL DEFAULT 0.0,
KI REAL NOT NULL DEFAULT 0.0,
... | true | true |
1c1dc4d5045b6f5438a9461e488edec81bcaaf26 | 4,561 | py | Python | graph_representation/methods/mesh.py | H4ndsomeJohn/CSNet | 10838a30be7cad6068a632fc32309ac13f22d339 | [
"MIT"
] | null | null | null | graph_representation/methods/mesh.py | H4ndsomeJohn/CSNet | 10838a30be7cad6068a632fc32309ac13f22d339 | [
"MIT"
] | null | null | null | graph_representation/methods/mesh.py | H4ndsomeJohn/CSNet | 10838a30be7cad6068a632fc32309ac13f22d339 | [
"MIT"
] | null | null | null | # import meshio
import numpy as np
import scipy.spatial
import torch
from graph_representation.methods.edge import add_to_edges, sort_Edges
from graph_representation.MRIData import MRIData
def makeMesh(data: MRIData):
edges_Ek = [[], []]
edges_Et = [[], []]
edges_Eb = [[], []]
# for b in [1]:
for... | 30.610738 | 93 | 0.542425 |
import numpy as np
import scipy.spatial
import torch
from graph_representation.methods.edge import add_to_edges, sort_Edges
from graph_representation.MRIData import MRIData
def makeMesh(data: MRIData):
edges_Ek = [[], []]
edges_Et = [[], []]
edges_Eb = [[], []]
for b in range(data.num):
... | true | true |
1c1dc4f9f464438576a57ef3983eedc9e9d4b527 | 1,511 | py | Python | src/components/number_fact_aio.py | bradley-erickson/dash-app-structure | 59ebd32626661c047a5baef38a5a0a9aa855243e | [
"MIT"
] | null | null | null | src/components/number_fact_aio.py | bradley-erickson/dash-app-structure | 59ebd32626661c047a5baef38a5a0a9aa855243e | [
"MIT"
] | null | null | null | src/components/number_fact_aio.py | bradley-erickson/dash-app-structure | 59ebd32626661c047a5baef38a5a0a9aa855243e | [
"MIT"
] | null | null | null | # notes
'''
This file is a simple AIO component that contains an input and a div.
The input determines which number you want a fact of.
For more information about AIO components, check out the official documentation:
https://dash.plotly.com/all-in-one-components
'''
# package imports
from dash import html, dcc, callba... | 23.609375 | 80 | 0.555261 |
from dash import html, dcc, callback, Output, Input, MATCH
import dash_bootstrap_components as dbc
import uuid
from utils.api import get_number_fact
class NumberFactAIO(html.Div):
class ids:
text = lambda aio_id: {
'component': 'NumberFactAIO',
'subcomponent': 'div',
... | true | true |
1c1dc5e57e5df3d1e947edf3ffaec5aa89e54bcc | 9,259 | py | Python | data_steward/cdr_cleaner/manual_cleaning_rules/ac70_map_health_insurance_responses.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 16 | 2017-06-30T20:05:05.000Z | 2022-03-08T21:03:19.000Z | data_steward/cdr_cleaner/manual_cleaning_rules/ac70_map_health_insurance_responses.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 342 | 2017-06-23T21:37:40.000Z | 2022-03-30T16:44:16.000Z | data_steward/cdr_cleaner/manual_cleaning_rules/ac70_map_health_insurance_responses.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 33 | 2017-07-01T00:12:20.000Z | 2022-01-26T18:06:53.000Z | """
For all answers for the survey question (43528428) and given pids,
1. Mark answers as invalid for all participants
2. Use the second survey (1384450) to generate valid answers for a subset of pids who took the second survey
"""
import csv
import logging
import bq_utils
from constants.cdr_cleaner import cl... | 32.950178 | 116 | 0.722756 |
import csv
import logging
import bq_utils
from constants.cdr_cleaner import clean_cdr as cdr_consts
LOGGER = logging.getLogger(__name__)
ORIGINAL_OBSERVATION_SOURCE_CONCEPT_ID = 43528428
HCAU_OBSERVATION_SOURCE_CONCEPT_ID = 1384450
INSURANCE_LOOKUP = 'insurance_lookup'
NEW_INSURANCE_ROWS = 'new_insurance_rows'
IN... | true | true |
1c1dc70b7e765bb4d0a142a385478b15e8d9e864 | 6,478 | py | Python | lib/services/autoscaling/ncloud_autoscaling/model/set_desired_capacity_response.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 12 | 2018-11-20T04:30:49.000Z | 2021-11-09T12:34:26.000Z | lib/services/autoscaling/ncloud_autoscaling/model/set_desired_capacity_response.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 1 | 2019-01-24T15:56:15.000Z | 2019-05-31T07:56:55.000Z | lib/services/autoscaling/ncloud_autoscaling/model/set_desired_capacity_response.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 6 | 2018-06-29T03:45:50.000Z | 2022-03-18T01:51:45.000Z | # coding: utf-8
"""
autoscaling
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from ncloud_autoscaling.model.auto_scaling_group import AutoScalingGroup # noqa: F401,E501
class SetDesiredCapacityResponse(object):
"""NOTE: Th... | 29.990741 | 140 | 0.6272 |
import pprint
import re
import six
from ncloud_autoscaling.model.auto_scaling_group import AutoScalingGroup
class SetDesiredCapacityResponse(object):
swagger_types = {
'request_id': 'str',
'return_code': 'str',
'return_message': 'str',
'total_rows': 'int',
'auto_... | true | true |
1c1dc7d273e6b85405a2816d29bbb8cdeaee558f | 959 | py | Python | immunohistochemical/models.py | rodrigoncalves/anato-hub | bb6c5a39bfbc247476a6ef4fe410c972b5e561c4 | [
"MIT"
] | null | null | null | immunohistochemical/models.py | rodrigoncalves/anato-hub | bb6c5a39bfbc247476a6ef4fe410c972b5e561c4 | [
"MIT"
] | null | null | null | immunohistochemical/models.py | rodrigoncalves/anato-hub | bb6c5a39bfbc247476a6ef4fe410c972b5e561c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models
from exam.models import Exam
class ImmunoHistochemicalStatus(models.Model):
description = models.CharField(max_length=50)
class ImmunoHistochemical(models.Model):
def exam_antibodies(self):
return AntibodiesTable.objects.filter(immunohistochemic... | 31.966667 | 76 | 0.755996 |
from django.db import models
from exam.models import Exam
class ImmunoHistochemicalStatus(models.Model):
description = models.CharField(max_length=50)
class ImmunoHistochemical(models.Model):
def exam_antibodies(self):
return AntibodiesTable.objects.filter(immunohistochemical=self.id)
clinic... | true | true |
1c1dc814ab89793a91b71a50665abae1d543f89e | 260,906 | py | Python | zerver/lib/actions.py | 100RABHpy/zulip | 80abc3f8294e20c5df13a8b35af3d5f75df30032 | [
"Apache-2.0"
] | null | null | null | zerver/lib/actions.py | 100RABHpy/zulip | 80abc3f8294e20c5df13a8b35af3d5f75df30032 | [
"Apache-2.0"
] | null | null | null | zerver/lib/actions.py | 100RABHpy/zulip | 80abc3f8294e20c5df13a8b35af3d5f75df30032 | [
"Apache-2.0"
] | null | null | null | import datetime
import itertools
import logging
import os
import time
from collections import defaultdict
from dataclasses import dataclass
from operator import itemgetter
from typing import (
AbstractSet,
Any,
Callable,
Dict,
Iterable,
List,
Mapping,
Optional,
Sequence,
Set,
... | 36.439385 | 122 | 0.678191 | import datetime
import itertools
import logging
import os
import time
from collections import defaultdict
from dataclasses import dataclass
from operator import itemgetter
from typing import (
AbstractSet,
Any,
Callable,
Dict,
Iterable,
List,
Mapping,
Optional,
Sequence,
Set,
... | true | true |
1c1dcae5a622df2419462613139b5d3deb680458 | 2,630 | py | Python | hummingbird/ml/operator_converters/__init__.py | rathijit/hummingbird | b634a4e5152757af2ff7a41059b3e52c8140fc04 | [
"MIT"
] | null | null | null | hummingbird/ml/operator_converters/__init__.py | rathijit/hummingbird | b634a4e5152757af2ff7a41059b3e52c8140fc04 | [
"MIT"
] | null | null | null | hummingbird/ml/operator_converters/__init__.py | rathijit/hummingbird | b634a4e5152757af2ff7a41059b3e52c8140fc04 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
All o... | 47.818182 | 89 | 0.731939 |
from . import constants as converter_constants
from .. import supported as hummingbird_constants
from .._utils import _Constants
constants = _Constants(converter_constants, hummingbird_constants)
from .onnx import onnx_operator
from .onnx import array_feature_extractor as onnx_afe
from .onnx import bina... | true | true |
1c1dcaf382f5925446eb3392afac2b843586480b | 389 | py | Python | GestioneMezzi/noleggi/migrations/0005_remove_auto_miniatura.py | foscomerlacci/GestioneMezzi | 75c4a6bfe4b210595bb4865d048a1a302af2095d | [
"MIT"
] | null | null | null | GestioneMezzi/noleggi/migrations/0005_remove_auto_miniatura.py | foscomerlacci/GestioneMezzi | 75c4a6bfe4b210595bb4865d048a1a302af2095d | [
"MIT"
] | null | null | null | GestioneMezzi/noleggi/migrations/0005_remove_auto_miniatura.py | foscomerlacci/GestioneMezzi | 75c4a6bfe4b210595bb4865d048a1a302af2095d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-02 21:56
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('noleggi', '0004_auto_miniatura'),
]
operations = [
migrations.RemoveField(
... | 19.45 | 47 | 0.609254 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('noleggi', '0004_auto_miniatura'),
]
operations = [
migrations.RemoveField(
model_name='auto',
name='miniatura',
),
]
| true | true |
1c1dcb770ff4b3bf8f8d2cf775de42dbc98d5474 | 5,658 | py | Python | Wwise Generate Gamesyncs Data Table.py | SoundsLikeJonny/Wwise-Unreal-Generate-Gamesyncs-Data-Table | 03aebbb5bf986384ce777f0466d614a943af9897 | [
"MIT"
] | null | null | null | Wwise Generate Gamesyncs Data Table.py | SoundsLikeJonny/Wwise-Unreal-Generate-Gamesyncs-Data-Table | 03aebbb5bf986384ce777f0466d614a943af9897 | [
"MIT"
] | null | null | null | Wwise Generate Gamesyncs Data Table.py | SoundsLikeJonny/Wwise-Unreal-Generate-Gamesyncs-Data-Table | 03aebbb5bf986384ce777f0466d614a943af9897 | [
"MIT"
] | null | null | null | # Wwise Generate Gamesyncs Data Table.py
#
# Created by: Jon Evans
# Created on: Mar 29, 2020
"""
This script has been written to work as part of a workflow optimization for
working in the Unreal Engine with Wwise Gamesyncs. This script will parse
the 'SoundbanksInfo.xml' file into the different switch, state and... | 36.503226 | 111 | 0.688406 |
import untangle
SOUNDBANK_PATH = 'SoundbanksInfo.xml'
INIT_BANK = 'Init.bnk'
DEFAULT_SURFACE_TYPE = '"SurfaceType_Default"'
CSV_TOP_ROW = '---,State/Switch_Group,State/Switch,PhysicalSurfaces\n'
STATE_NONE = 'None'
NAME_STR = 'Name'
SUCCESS_MESSAGE = 'File(s) generated in current folder'
output_fi... | true | true |
1c1dcc0b54a0877aecbcae3053e374c89ed077d5 | 290 | py | Python | lunes_cms/cms/admins/group_api_key_admin.py | digitalfabrik/visual-vocabulary-trainer | 8432bb307819257728751e008efe1aa01df7ccf2 | [
"Apache-2.0"
] | 4 | 2020-01-23T18:49:10.000Z | 2020-09-10T09:57:38.000Z | lunes_cms/cms/admins/group_api_key_admin.py | digitalfabrik/visual-vocabulary-trainer | 8432bb307819257728751e008efe1aa01df7ccf2 | [
"Apache-2.0"
] | 40 | 2020-01-23T10:46:11.000Z | 2020-12-16T11:28:05.000Z | lunes_cms/cms/admins/group_api_key_admin.py | digitalfabrik/visual-vocabulary-trainer | 8432bb307819257728751e008efe1aa01df7ccf2 | [
"Apache-2.0"
] | 3 | 2020-08-24T08:36:16.000Z | 2020-09-17T08:39:25.000Z | from rest_framework_api_key.admin import APIKeyModelAdmin
class GroupAPIKeyAdmin(APIKeyModelAdmin):
exclude = ("objects",)
list_display = [*APIKeyModelAdmin.list_display, "organization"]
search_fields = [*APIKeyModelAdmin.search_fields, "organization"]
list_per_page = 25
| 32.222222 | 69 | 0.775862 | from rest_framework_api_key.admin import APIKeyModelAdmin
class GroupAPIKeyAdmin(APIKeyModelAdmin):
exclude = ("objects",)
list_display = [*APIKeyModelAdmin.list_display, "organization"]
search_fields = [*APIKeyModelAdmin.search_fields, "organization"]
list_per_page = 25
| true | true |
1c1dcceb24d6b01c63841a7aa80b5e06365cffee | 4,769 | py | Python | Core/Solvers/MSSP/FSNAC.py | zztcok/SNAC_PSNAC | 9119c325c2114ac7034362b5349ffc5b2ce895d6 | [
"Apache-2.0"
] | 1 | 2020-12-22T23:04:59.000Z | 2020-12-22T23:04:59.000Z | Core/Solvers/MSSP/FSNAC.py | zztcok/SNAC_PSNAC | 9119c325c2114ac7034362b5349ffc5b2ce895d6 | [
"Apache-2.0"
] | null | null | null | Core/Solvers/MSSP/FSNAC.py | zztcok/SNAC_PSNAC | 9119c325c2114ac7034362b5349ffc5b2ce895d6 | [
"Apache-2.0"
] | 1 | 2020-12-21T21:46:04.000Z | 2020-12-21T21:46:04.000Z | import sys
import os
from coopr.opt import SolverFactory, SolverManagerFactory, SolverStatus, TerminationCondition, SolutionStatus
from pyutilib.misc import Options
from defunction import SAA_LP, deLR
import pdb
import gc
def Run_FSNAC(problem_data, fixed_parameters,output_directory):
opt = SolverFactory("cplex")
o... | 40.07563 | 494 | 0.585448 | import sys
import os
from coopr.opt import SolverFactory, SolverManagerFactory, SolverStatus, TerminationCondition, SolutionStatus
from pyutilib.misc import Options
from defunction import SAA_LP, deLR
import pdb
import gc
def Run_FSNAC(problem_data, fixed_parameters,output_directory):
opt = SolverFactory("cplex")
o... | true | true |
1c1dcdd364a3532ff2ccae42edaa4d89c932df22 | 2,121 | py | Python | train_word2vec.py | Whoolly/ByteCup2018 | 348bdee3215c146ef7d6e4fe1fecbe4598798c8a | [
"MIT"
] | 2 | 2018-12-28T14:06:01.000Z | 2019-01-10T07:02:34.000Z | train_word2vec.py | Whoolly/ByteCup2018 | 348bdee3215c146ef7d6e4fe1fecbe4598798c8a | [
"MIT"
] | null | null | null | train_word2vec.py | Whoolly/ByteCup2018 | 348bdee3215c146ef7d6e4fe1fecbe4598798c8a | [
"MIT"
] | null | null | null | """ Pretrain a word2vec on the corpus"""
import argparse
import json
import logging
import os
from time import time
from datetime import timedelta
from cytoolz import concatv
import gensim
from utils import count_data
class Sentences(object):
""" needed for gensim word2vec training"""
def __init__(self, data_... | 35.35 | 106 | 0.659123 | import argparse
import json
import logging
import os
from time import time
from datetime import timedelta
from cytoolz import concatv
import gensim
from utils import count_data
class Sentences(object):
def __init__(self, data_dir):
self._path = os.path.join(data_dir, 'train')
self._n_data = count_... | true | true |
1c1dce46adca770ee2c99dd96595d1c3be08e963 | 5,309 | py | Python | custom_functions.py | Alejandro-Casanova/MusicImproviser | 55fae568b68dd9c236ed76fc8e83c9271bcc6826 | [
"MIT"
] | null | null | null | custom_functions.py | Alejandro-Casanova/MusicImproviser | 55fae568b68dd9c236ed76fc8e83c9271bcc6826 | [
"MIT"
] | null | null | null | custom_functions.py | Alejandro-Casanova/MusicImproviser | 55fae568b68dd9c236ed76fc8e83c9271bcc6826 | [
"MIT"
] | null | null | null | import sys
import time
from mingus.core import scales, notes, keys
from mingus.containers import Note, Bar
from mingus.midi import fluidsynth
from random import randint, random, choice
def is_mayor(key):
if key[0].isupper():
return 1
else:
return 0
# Relative Modulation, changes the key to ... | 31.229412 | 95 | 0.599548 | import sys
import time
from mingus.core import scales, notes, keys
from mingus.containers import Note, Bar
from mingus.midi import fluidsynth
from random import randint, random, choice
def is_mayor(key):
if key[0].isupper():
return 1
else:
return 0
def relative_modulation(key):
if type... | true | true |
1c1dcfb6f33be408b91dfe5b0fc8af0984e9a699 | 3,354 | py | Python | rename.py | Luckcheese/icon_renamer | d0337e1dc7e69084e854fc5f66f5d4f59420775b | [
"Unlicense",
"MIT"
] | 1 | 2016-10-25T13:34:06.000Z | 2016-10-25T13:34:06.000Z | rename.py | Luckcheese/icon_renamer | d0337e1dc7e69084e854fc5f66f5d4f59420775b | [
"Unlicense",
"MIT"
] | null | null | null | rename.py | Luckcheese/icon_renamer | d0337e1dc7e69084e854fc5f66f5d4f59420775b | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import os
import shutil, errno
import re
import json
def process_params():
parser = argparse.ArgumentParser(description='Rename an icon downloaded from design.google.com/icons/')
parser.add_argument('--currentIconName', dest='oldName', required=True, help='the current ico... | 29.421053 | 153 | 0.683661 |
import argparse
import os
import shutil, errno
import re
import json
def process_params():
parser = argparse.ArgumentParser(description='Rename an icon downloaded from design.google.com/icons/')
parser.add_argument('--currentIconName', dest='oldName', required=True, help='the current icon name (without the s... | true | true |
1c1dcfec855ef9b55c5e10d9e671d9aa9a8c9e77 | 205 | py | Python | sample11.py | HumanAcademy-AI-Cource/2021_02Sample | 8873c1d58e25dac10106271c809cab34001db588 | [
"Apache-2.0"
] | null | null | null | sample11.py | HumanAcademy-AI-Cource/2021_02Sample | 8873c1d58e25dac10106271c809cab34001db588 | [
"Apache-2.0"
] | null | null | null | sample11.py | HumanAcademy-AI-Cource/2021_02Sample | 8873c1d58e25dac10106271c809cab34001db588 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*
kekka1 = 5 + 5 # 5+5 の結果をkekka1にコピー
print(kekka1) # kekka1 を表示
kekka2 = kekka1 + 10 # kekka1 + 10 の結果をkekka2にコピー
print(kekka2) # kekka2 を表示 | 25.625 | 52 | 0.609756 |
kekka1 = 5 + 5
print(kekka1)
kekka2 = kekka1 + 10
print(kekka2) | true | true |
1c1dd18fd0aa5568e55ce9d5a7318a60a14cdf10 | 2,312 | py | Python | admin_sso/models.py | the-Bruce/uwcs-go | ed00bbf45f3cd02d4ac136e54d93a17f1f867399 | [
"MIT"
] | null | null | null | admin_sso/models.py | the-Bruce/uwcs-go | ed00bbf45f3cd02d4ac136e54d93a17f1f867399 | [
"MIT"
] | null | null | null | admin_sso/models.py | the-Bruce/uwcs-go | ed00bbf45f3cd02d4ac136e54d93a17f1f867399 | [
"MIT"
] | 1 | 2021-10-30T20:49:02.000Z | 2021-10-30T20:49:02.000Z | from __future__ import unicode_literals
import fnmatch
from django.db import models
from django.utils.translation import gettext_lazy as _
from admin_sso import settings
class AssignmentManager(models.Manager):
def for_user_profile(self, username, roles, staff, superuser):
def _match_groups(asm):
... | 34 | 86 | 0.612024 | from __future__ import unicode_literals
import fnmatch
from django.db import models
from django.utils.translation import gettext_lazy as _
from admin_sso import settings
class AssignmentManager(models.Manager):
def for_user_profile(self, username, roles, staff, superuser):
def _match_groups(asm):
... | true | true |
1c1dd1b06fd84c0d944483603e84735dd8ee46ee | 1,771 | py | Python | nova/tests/integrated/test_xml.py | bopopescu/zknova | 8dd09199f5678697be228ffceeaf2c16f6d7319d | [
"Apache-2.0"
] | null | null | null | nova/tests/integrated/test_xml.py | bopopescu/zknova | 8dd09199f5678697be228ffceeaf2c16f6d7319d | [
"Apache-2.0"
] | null | null | null | nova/tests/integrated/test_xml.py | bopopescu/zknova | 8dd09199f5678697be228ffceeaf2c16f6d7319d | [
"Apache-2.0"
] | 1 | 2020-07-24T08:25:25.000Z | 2020-07-24T08:25:25.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Justin Santa Barbara
# 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.apach... | 34.057692 | 78 | 0.693958 |
from lxml import etree
from nova.api.openstack import common
from nova.api.openstack import xmlutil
from nova.openstack.common.log import logging
from nova.tests.integrated import integrated_helpers
LOG = logging.getLogger(__name__)
class XmlTests(integrated_helpers._IntegratedTestBase):
def ... | true | true |
1c1dd3f3c0f0b6d4da277095e896e902dccde216 | 224 | py | Python | pakkr/__init__.py | ePak/pakkr | 20c42251356233877c6f2e7a0a46af9c3cf88e00 | [
"Apache-2.0"
] | 14 | 2020-01-14T08:07:31.000Z | 2021-09-28T21:36:53.000Z | pakkr/__init__.py | ePak/pakkr | 20c42251356233877c6f2e7a0a46af9c3cf88e00 | [
"Apache-2.0"
] | 5 | 2020-03-24T20:09:58.000Z | 2021-07-01T11:21:38.000Z | pakkr/__init__.py | ePak/pakkr | 20c42251356233877c6f2e7a0a46af9c3cf88e00 | [
"Apache-2.0"
] | 4 | 2020-03-04T22:37:10.000Z | 2021-12-07T17:22:17.000Z | from pakkr.pipeline import Pipeline # noqa: F401
from pakkr.returns.returns import returns # noqa: F401
from pakkr.cmd_args.cmd_args import cmd_args # noqa: F401
from pakkr.cmd_args.argument import argument # noqa: F401
| 44.8 | 58 | 0.790179 | from pakkr.pipeline import Pipeline
from pakkr.returns.returns import returns
from pakkr.cmd_args.cmd_args import cmd_args
from pakkr.cmd_args.argument import argument
| true | true |
1c1dd4062a5b5e7812051cf5959db7b3e0126d35 | 13,983 | py | Python | diagnose_error.py | gares/coq-tools | f270f5ad7e09661e191499bc028165e71300b157 | [
"MIT"
] | null | null | null | diagnose_error.py | gares/coq-tools | f270f5ad7e09661e191499bc028165e71300b157 | [
"MIT"
] | null | null | null | diagnose_error.py | gares/coq-tools | f270f5ad7e09661e191499bc028165e71300b157 | [
"MIT"
] | null | null | null | from __future__ import with_statement, print_function
import os, sys, tempfile, subprocess, re, time, math, glob, threading, shutil, traceback
from Popen_noblock import Popen_async, Empty
from memoize import memoize
from file_util import clean_v_file
from util import re_escape
from custom_arguments import LOG_ALWAYS
fr... | 48.721254 | 276 | 0.6706 | from __future__ import with_statement, print_function
import os, sys, tempfile, subprocess, re, time, math, glob, threading, shutil, traceback
from Popen_noblock import Popen_async, Empty
from memoize import memoize
from file_util import clean_v_file
from util import re_escape
from custom_arguments import LOG_ALWAYS
fr... | true | true |
1c1dd5cd8674cf7854d6745ddbc2da02d0e1860e | 3,624 | py | Python | huggingface/nlp/demo.py | singularitatem/singularity | 3b7992244a4c152be42c207b15c2023e0da305a5 | [
"Apache-2.0"
] | null | null | null | huggingface/nlp/demo.py | singularitatem/singularity | 3b7992244a4c152be42c207b15c2023e0da305a5 | [
"Apache-2.0"
] | null | null | null | huggingface/nlp/demo.py | singularitatem/singularity | 3b7992244a4c152be42c207b15c2023e0da305a5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from absl import app, flags, logging
import torch as th
import pytorch_lightning as pl
import nlp
import transformers
flags.DEFINE_boolean('debug', False, '')
flags.DEFINE_integer('epochs', 10, '')
flags.DEFINE_float('lr', 1e-2, '')
flags.DEFINE_float('momentum', .9, '')
flags.DEFINE_string('... | 31.789474 | 105 | 0.58968 |
from absl import app, flags, logging
import torch as th
import pytorch_lightning as pl
import nlp
import transformers
flags.DEFINE_boolean('debug', False, '')
flags.DEFINE_integer('epochs', 10, '')
flags.DEFINE_float('lr', 1e-2, '')
flags.DEFINE_float('momentum', .9, '')
flags.DEFINE_string('bert_model', 'bert-bas... | true | true |
1c1dd7a9463de2db6570161be0a76714af05367b | 42,769 | py | Python | picosdk/ps5000a.py | FRoith/picosdk-python-wrappers | 329a9127a543e746f2baa584f608346f8ec09cdd | [
"ISC"
] | null | null | null | picosdk/ps5000a.py | FRoith/picosdk-python-wrappers | 329a9127a543e746f2baa584f608346f8ec09cdd | [
"ISC"
] | null | null | null | picosdk/ps5000a.py | FRoith/picosdk-python-wrappers | 329a9127a543e746f2baa584f608346f8ec09cdd | [
"ISC"
] | 1 | 2019-10-17T08:36:10.000Z | 2019-10-17T08:36:10.000Z | #
# Copyright (C) 2014-2018 Pico Technology Ltd. See LICENSE file for terms.
#
"""
This is a Python module defining the functions from the ps5000aApi.h C header
file for PicoScope 5000 Series oscilloscopes using the ps5000a driver API
functions.
"""
from ctypes import *
from picosdk.ctypes_wrapper import C_CALLBACK_F... | 35.434134 | 119 | 0.608268 |
from ctypes import *
from picosdk.ctypes_wrapper import C_CALLBACK_FUNCTION_FACTORY
from picosdk.library import Library
from picosdk.constants import make_enum
class Ps5000alib(Library):
def __init__(self):
super(Ps5000alib, self).__init__("ps5000a")
ps5000a = Ps5000alib()
ps5000a.PS5000A_DEVICE_R... | true | true |
1c1dd88a877737819b86c18522a2f2533d21847f | 12,841 | py | Python | python/cuml/test/test_train_test_split.py | garanews/cuml | 318f521a1d2681f4622a44921d27b5f592fe4407 | [
"Apache-2.0"
] | 1 | 2021-01-01T10:52:18.000Z | 2021-01-01T10:52:18.000Z | python/cuml/test/test_train_test_split.py | garanews/cuml | 318f521a1d2681f4622a44921d27b5f592fe4407 | [
"Apache-2.0"
] | null | null | null | python/cuml/test/test_train_test_split.py | garanews/cuml | 318f521a1d2681f4622a44921d27b5f592fe4407 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.334225 | 78 | 0.585391 |
import cudf
import cupy as cp
import numpy as np
import pytest
from cuml.preprocessing.model_selection import train_test_split
from cuml.datasets import make_classification
from numba import cuda
test_array_input_types = [
'numba', 'cupy'
]
test_seeds = [
'int', 'cupy', 'numpy'
]
@pytest.mar... | true | true |
1c1dd9e64eefdb277b9f8efde85b4a3eb650529c | 23,663 | py | Python | autotest/utilities/test_ogrinfo.py | nyalldawson/gdal | 312cfe2d6fc564af4558279cc8f321d6e2a687ad | [
"MIT"
] | 1 | 2020-02-22T01:28:29.000Z | 2020-02-22T01:28:29.000Z | autotest/utilities/test_ogrinfo.py | norBIT/gdal | 64855dbee2cd0dff47da11d916c8d2703b4e99b8 | [
"MIT"
] | null | null | null | autotest/utilities/test_ogrinfo.py | norBIT/gdal | 64855dbee2cd0dff47da11d916c8d2703b4e99b8 | [
"MIT"
] | 2 | 2018-05-08T01:51:34.000Z | 2019-06-26T05:08:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: ogrinfo testing
# Author: Even Rouault <even dot rouault @ mines-paris dot org>
#
#########################################################... | 32.504121 | 177 | 0.598191 |
1645.312500, 4765610.500000)
Layer SRS WKT:
PROJCS["OSGB 1936 / British National Grid",
GEOGCS["OSGB 1936",
DATUM["OSGB_1936",
SPHEROID["Airy_1830",6377563.396,299.3249646]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Transverse_Mercator"],
... | true | true |
1c1dda29bb87abf6195a4b7465b286e06a728dcc | 308 | py | Python | seed.py | ethylomat/MathPhysTheoTS | 76144c3990d9511817cfaa007a75ec55bc8e7310 | [
"MIT"
] | 1 | 2019-04-29T22:23:22.000Z | 2019-04-29T22:23:22.000Z | seed.py | ethylomat/MathPhysTheoTS | 76144c3990d9511817cfaa007a75ec55bc8e7310 | [
"MIT"
] | 2 | 2016-08-11T14:26:47.000Z | 2016-08-11T14:29:44.000Z | seed.py | ethylomat/MathPhysTheoTS | 76144c3990d9511817cfaa007a75ec55bc8e7310 | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
from app import db, Ticket
import os
os.system("rm tickets.db")
validcode_file = "test.txt"
db.create_all()
with open(validcode_file) as f:
content = f.read().splitlines()[1:]
for i in content:
ticket = Ticket(i)
db.session.add(ticket)
db.session.commit()
| 16.210526 | 39 | 0.727273 | from flask_sqlalchemy import SQLAlchemy
from app import db, Ticket
import os
os.system("rm tickets.db")
validcode_file = "test.txt"
db.create_all()
with open(validcode_file) as f:
content = f.read().splitlines()[1:]
for i in content:
ticket = Ticket(i)
db.session.add(ticket)
db.session.commit()
| true | true |
1c1ddaf78c616d29ea86c890bf4bc23e2acd8ada | 5,685 | py | Python | svtools/copynumber.py | NeolithEra/svtools | 6a6a7b059df196ec49de6cd0b8ff816942f9055a | [
"MIT"
] | 120 | 2015-06-10T08:48:55.000Z | 2022-03-22T13:17:50.000Z | svtools/copynumber.py | NeolithEra/svtools | 6a6a7b059df196ec49de6cd0b8ff816942f9055a | [
"MIT"
] | 281 | 2015-05-01T20:08:54.000Z | 2022-01-26T23:14:51.000Z | svtools/copynumber.py | NeolithEra/svtools | 6a6a7b059df196ec49de6cd0b8ff816942f9055a | [
"MIT"
] | 52 | 2015-06-08T20:17:08.000Z | 2022-03-14T19:57:49.000Z | import argparse
import sys
from subprocess import Popen, PIPE
from svtools.vcf.file import Vcf
import svtools.utils as su
def run_cnvnator(cnvnator_path, root, window, coord_list):
# Read and run cnvnator
p1 = Popen(['cat', coord_list.name], stdout=PIPE)
cmd = map(str, [cnvnator_path, '-root', root, '-geno... | 46.598361 | 201 | 0.630431 | import argparse
import sys
from subprocess import Popen, PIPE
from svtools.vcf.file import Vcf
import svtools.utils as su
def run_cnvnator(cnvnator_path, root, window, coord_list):
p1 = Popen(['cat', coord_list.name], stdout=PIPE)
cmd = map(str, [cnvnator_path, '-root', root, '-genotype', window])
p2 ... | true | true |
1c1ddb9011f9d50a162ca14296f8867a6d953361 | 8,857 | py | Python | Tools/scons/scons-local/SCons/Tool/javac.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Tool/javac.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Tool/javac.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """SCons.Tool.javac
Tool-specific initialization for javac.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, f... | 37.850427 | 159 | 0.594897 |
__revision__ = "src/engine/SCons/Tool/javac.py 2018/09/30 19:25:33 Sye"
import os
import os.path
from collections import OrderedDict
import SCons.Action
import SCons.Builder
from SCons.Node.FS import _my_normcase
from SCons.Tool.JavaCommon import parse_java_file
import SCons.Util
... | true | true |
1c1ddbc90e1ed3d16c3ec0e1846139679830c6b5 | 1,706 | py | Python | Examples/IPlugConvoEngine/scripts/make_zip.py | badi91/iPlug2 | e508e85060871cef4ff16c9bc80c503c375e0a14 | [
"Zlib"
] | 1,305 | 2018-07-28T08:48:47.000Z | 2022-03-31T23:06:59.000Z | Examples/IPlugConvoEngine/scripts/make_zip.py | badi91/iPlug2 | e508e85060871cef4ff16c9bc80c503c375e0a14 | [
"Zlib"
] | 582 | 2019-01-01T15:37:55.000Z | 2022-03-30T22:57:16.000Z | Examples/IPlugConvoEngine/scripts/make_zip.py | badi91/iPlug2 | e508e85060871cef4ff16c9bc80c503c375e0a14 | [
"Zlib"
] | 284 | 2018-10-17T22:16:26.000Z | 2022-03-30T15:38:19.000Z | import zipfile, os, fileinput, string, sys
scriptpath = os.path.dirname(os.path.realpath(__file__))
projectpath = os.path.abspath(os.path.join(scriptpath, os.pardir))
MajorStr = ""
MinorStr = ""
BugfixStr = ""
BUNDLE_NAME = ""
def main():
if len(sys.argv) != 2:
print("Usage: make_zip.py demo(0 or 1)")
sy... | 27.967213 | 72 | 0.655334 | import zipfile, os, fileinput, string, sys
scriptpath = os.path.dirname(os.path.realpath(__file__))
projectpath = os.path.abspath(os.path.join(scriptpath, os.pardir))
MajorStr = ""
MinorStr = ""
BugfixStr = ""
BUNDLE_NAME = ""
def main():
if len(sys.argv) != 2:
print("Usage: make_zip.py demo(0 or 1)")
sy... | true | true |
1c1ddde4c2b5ef9c2425b068010f461383bbb4c7 | 8,785 | py | Python | autobahntestsuite/autobahntestsuite/wsperfmaster.py | MichalMazurek/AutobahnTestSuite | f9f39e0dca69ad66568fe6f608ec9e8b9fd2b60d | [
"Apache-2.0"
] | 1 | 2017-06-17T15:47:37.000Z | 2017-06-17T15:47:37.000Z | autobahntestsuite/autobahntestsuite/wsperfmaster.py | MichalMazurek/AutobahnTestSuite | f9f39e0dca69ad66568fe6f608ec9e8b9fd2b60d | [
"Apache-2.0"
] | null | null | null | autobahntestsuite/autobahntestsuite/wsperfmaster.py | MichalMazurek/AutobahnTestSuite | f9f39e0dca69ad66568fe6f608ec9e8b9fd2b60d | [
"Apache-2.0"
] | null | null | null | ###############################################################################
##
## Copyright 2012 Tavendo GmbH
##
## 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... | 35.857143 | 221 | 0.584178 | lf.registerForPubSub(URI_EVENT, True)
class WsPerfMasterUiFactory(WampServerFactory):
protocol = WsPerfMasterUiProtocol
def slaveConnected(self, id, host, port, version, num_workers, ident):
self._dispatchEvent(URI_EVENT + "slaveConnected", {'id': id,
... | false | true |
1c1dde0303bba5f6f85a640eb6ea5e3db317748d | 1,864 | py | Python | src/data/stemming.py | sarisboo/extractive_sum | 45900b578c39385c82a8effbc05c61f3ff7aef24 | [
"MIT"
] | null | null | null | src/data/stemming.py | sarisboo/extractive_sum | 45900b578c39385c82a8effbc05c61f3ff7aef24 | [
"MIT"
] | null | null | null | src/data/stemming.py | sarisboo/extractive_sum | 45900b578c39385c82a8effbc05c61f3ff7aef24 | [
"MIT"
] | null | null | null | from nltk.stem import PorterStemmer
from ast import literal_eval
import pandas as pd
# Porter Stemmer is the oldest, it uses suffix stripping.
# It uses rules to decide whether it is wise to strip a suffix.
# we use it for its simplicity and speed
porter = PorterStemmer()
def stemmer(stemmed_sent):
"""
Remov... | 28.242424 | 87 | 0.674356 | from nltk.stem import PorterStemmer
from ast import literal_eval
import pandas as pd
porter = PorterStemmer()
def stemmer(stemmed_sent):
porter = PorterStemmer()
stemmed_sentence = []
for word in literal_eval(stemmed_sent):
stemmed_word = porter.stem(word)
stemmed_sentence.append(stemm... | true | true |
1c1dde7c2da91760f8d09c50d08514237c1c65f9 | 5,835 | py | Python | methods/shapefiles.py | VU-IVM/Toponym-based-Algorithm-for-Grouped-Geoparsing-of-Social-media | 563cab3208c1b86837c45ba6ce33d740113c44af | [
"MIT"
] | 6 | 2018-05-27T00:43:13.000Z | 2022-03-08T16:35:47.000Z | methods/shapefiles.py | VU-IVM/Toponym-based-Algorithm-for-Grouped-Geoparsing-of-Social-media | 563cab3208c1b86837c45ba6ce33d740113c44af | [
"MIT"
] | null | null | null | methods/shapefiles.py | VU-IVM/Toponym-based-Algorithm-for-Grouped-Geoparsing-of-Social-media | 563cab3208c1b86837c45ba6ce33d740113c44af | [
"MIT"
] | 3 | 2018-09-03T13:09:00.000Z | 2022-03-08T16:35:51.000Z | #!/usr/bin/python3
from osgeo import ogr
import os
import numpy as np
import matplotlib.path as mpath
from collections import defaultdict as dd
import shapefile as pyshp
import matplotlib.path
import matplotlib.patches as mpatches
from methods import function
def open_shape(shapefile):
return pyshp.Reader(shapef... | 29.029851 | 144 | 0.636847 |
from osgeo import ogr
import os
import numpy as np
import matplotlib.path as mpath
from collections import defaultdict as dd
import shapefile as pyshp
import matplotlib.path
import matplotlib.patches as mpatches
from methods import function
def open_shape(shapefile):
return pyshp.Reader(shapefile)
def open_sh... | true | true |
1c1dde9781033aa73e844d36d2d3cab31775a8f7 | 867 | py | Python | software/perception/mfallon_sandbox/python/fast_demo.py | liangfok/oh-distro | eeee1d832164adce667e56667dafc64a8d7b8cee | [
"BSD-3-Clause"
] | 92 | 2016-01-14T21:03:50.000Z | 2021-12-01T17:57:46.000Z | software/perception/mfallon_sandbox/python/fast_demo.py | liangfok/oh-distro | eeee1d832164adce667e56667dafc64a8d7b8cee | [
"BSD-3-Clause"
] | 62 | 2016-01-16T18:08:14.000Z | 2016-03-24T15:16:28.000Z | software/perception/mfallon_sandbox/python/fast_demo.py | liangfok/oh-distro | eeee1d832164adce667e56667dafc64a8d7b8cee | [
"BSD-3-Clause"
] | 41 | 2016-01-14T21:26:58.000Z | 2022-03-28T03:10:39.000Z | # fast ok
# harris better
# cv2.goodFeaturesToTrack()
# - matt
import numpy as np
import cv2
from matplotlib import pyplot as plt
img = cv2.imread('utah.jpg',0)
# Initiate FAST object with default values
fast = cv2.FastFeatureDetector()
# find and draw the keypoints
kp = fast.detect(img,None)
img2 = cv2.drawKeypoi... | 23.432432 | 62 | 0.743945 |
import numpy as np
import cv2
from matplotlib import pyplot as plt
img = cv2.imread('utah.jpg',0)
fast = cv2.FastFeatureDetector()
kp = fast.detect(img,None)
img2 = cv2.drawKeypoints(img, kp, color=(255,0,0))
print "Threshold: ", fast.getInt('threshold')
print "nonmaxSuppression: ", fast.getBool('nonmaxSup... | false | true |
1c1ddee3fae97bac340d9e8daaea59419ac93fd9 | 5,834 | py | Python | OLD Project/Leetcode_txt_file_project/submissions.py | sudhirrd007/LeetCode-scraper | de87ff17fff2c73e67392321df1107cce7cbf883 | [
"MIT"
] | null | null | null | OLD Project/Leetcode_txt_file_project/submissions.py | sudhirrd007/LeetCode-scraper | de87ff17fff2c73e67392321df1107cce7cbf883 | [
"MIT"
] | null | null | null | OLD Project/Leetcode_txt_file_project/submissions.py | sudhirrd007/LeetCode-scraper | de87ff17fff2c73e67392321df1107cce7cbf883 | [
"MIT"
] | null | null | null | import time
from element_existence import element_existence_check
# for now this only fetch the latest submission
# modify it to fetch all submission later
def fetch_submission_trs(driver):
Xpath = '//*[@id="app"]/div/div[2]/div[1]/div/div[1]/div/div[1]/div[1]/div/div[1]/div/div[4]'
driver.find_element_by_xpa... | 41.084507 | 140 | 0.553822 | import time
from element_existence import element_existence_check
def fetch_submission_trs(driver):
Xpath = '//*[@id="app"]/div/div[2]/div[1]/div/div[1]/div/div[1]/div[1]/div/div[1]/div/div[4]'
driver.find_element_by_xpath(Xpath).click()
time.sleep(0.5)
Xpath = '//*[@id="app"]/div/div[2]/div[1... | true | true |
1c1ddf17adf72e62a78136fd3ec4ae73ab6abd83 | 6,256 | py | Python | tempest/cli/simple_read_only/test_nova.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/cli/simple_read_only/test_nova.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/cli/simple_read_only/test_nova.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 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/LICENSE-2.0
#
# Unless requ... | 30.517073 | 78 | 0.650575 |
import subprocess
import testtools
import tempest.cli
from tempest import config
from tempest.openstack.common import log as logging
import tempest.test
CONF = config.CONF
LOG = logging.getLogger(__name__)
class SimpleReadOnlyNovaClientTest(tempest.cli.ClientTestBase):
@classmethod
def se... | true | true |
1c1ddf5b17cb1c8a12da9564c30d9469ae36931a | 1,546 | py | Python | setup.py | florian-hoenicke/portforward | b95f10a985abf326724b891d30927c025b89adcb | [
"MIT"
] | null | null | null | setup.py | florian-hoenicke/portforward | b95f10a985abf326724b891d30927c025b89adcb | [
"MIT"
] | null | null | null | setup.py | florian-hoenicke/portforward | b95f10a985abf326724b891d30927c025b89adcb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages, Extension
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = []
test_requirements = ["pytest>=3", ]
setup(
... | 28.62963 | 74 | 0.636481 |
from setuptools import setup, find_packages, Extension
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = []
test_requirements = ["pytest>=3", ]
setup(
author="Sebastian Ziemann",
author_email... | true | true |
1c1ddf89e2a89dbb67d38cabf30fc5b889a381c6 | 1,659 | py | Python | src/constants.py | uraich/twatch2020_firmware | e0a205107609a0aa3eb97c517b6e1af6f7c0bbb5 | [
"MIT"
] | 3 | 2021-01-30T23:02:48.000Z | 2021-12-15T18:46:52.000Z | src/constants.py | uraich/twatch2020_firmware | e0a205107609a0aa3eb97c517b6e1af6f7c0bbb5 | [
"MIT"
] | null | null | null | src/constants.py | uraich/twatch2020_firmware | e0a205107609a0aa3eb97c517b6e1af6f7c0bbb5 | [
"MIT"
] | null | null | null | from micropython import const
class Constants:
MAINBAR_APP_TILE_X_START = const(0)
MAINBAR_APP_TILE_Y_START = const(4)
STATUSBAR_HEIGHT = const(26)
STATUS_BAR_WIDTH = const(200)
MAX_APPS_ICON_HORZ = 3
MAX_APPS_ICON_VERT = 2
MAX_APPS_TILES = 3
MAX_APPS_ICON = MAX_APPS_ICON_HORZ *... | 38.581395 | 138 | 0.714286 | from micropython import const
class Constants:
MAINBAR_APP_TILE_X_START = const(0)
MAINBAR_APP_TILE_Y_START = const(4)
STATUSBAR_HEIGHT = const(26)
STATUS_BAR_WIDTH = const(200)
MAX_APPS_ICON_HORZ = 3
MAX_APPS_ICON_VERT = 2
MAX_APPS_TILES = 3
MAX_APPS_ICON = MAX_APPS_ICON_HORZ *... | true | true |
1c1de12cdd5d02c2e989e0d9f2369c336c3911c8 | 10,712 | py | Python | tests/integration/contrib/django/test_django_project.py | Yarn-e/openapi-core | fda9fbd3bc1c0879818e00445e1ad0731f80b065 | [
"BSD-3-Clause"
] | 160 | 2017-11-20T13:39:04.000Z | 2022-03-31T14:48:27.000Z | tests/integration/contrib/django/test_django_project.py | Yarn-e/openapi-core | fda9fbd3bc1c0879818e00445e1ad0731f80b065 | [
"BSD-3-Clause"
] | 384 | 2017-09-21T12:42:31.000Z | 2022-03-21T17:21:05.000Z | tests/integration/contrib/django/test_django_project.py | Yarn-e/openapi-core | fda9fbd3bc1c0879818e00445e1ad0731f80b065 | [
"BSD-3-Clause"
] | 100 | 2017-11-21T08:07:01.000Z | 2022-01-20T20:32:52.000Z | import os
import sys
from base64 import b64encode
from json import dumps
from unittest import mock
import pytest
class BaseTestDjangoProject:
api_key = "12345"
@property
def api_key_encoded(self):
api_key_bytes = self.api_key.encode("utf8")
api_key_bytes_enc = b64encode(api_key_bytes)
... | 29.67313 | 77 | 0.472461 | import os
import sys
from base64 import b64encode
from json import dumps
from unittest import mock
import pytest
class BaseTestDjangoProject:
api_key = "12345"
@property
def api_key_encoded(self):
api_key_bytes = self.api_key.encode("utf8")
api_key_bytes_enc = b64encode(api_key_bytes)
... | true | true |
1c1de1b3ad076279c514549aa7ba92249163d211 | 219 | py | Python | src/saesutils/__init__.py | Johumel/SAES | 0152c1563e5bc4c87822dbf6dfc66710cae60eb0 | [
"MIT"
] | 9 | 2019-06-04T14:42:54.000Z | 2022-01-29T01:06:23.000Z | src/saesutils/__init__.py | Johumel/SAES | 0152c1563e5bc4c87822dbf6dfc66710cae60eb0 | [
"MIT"
] | null | null | null | src/saesutils/__init__.py | Johumel/SAES | 0152c1563e5bc4c87822dbf6dfc66710cae60eb0 | [
"MIT"
] | 3 | 2021-03-30T02:42:34.000Z | 2022-03-29T08:59:17.000Z | from .read_controlfile import *
from .get_time_window import *
from .read_cclist import *
from .read_eventlist import *
from .read_ext_timetable import *
from .read_xml import *
from .get_arv_time_from_pyrocko import *
| 27.375 | 40 | 0.808219 | from .read_controlfile import *
from .get_time_window import *
from .read_cclist import *
from .read_eventlist import *
from .read_ext_timetable import *
from .read_xml import *
from .get_arv_time_from_pyrocko import *
| true | true |
1c1de1cdda5c343498bd6e96937a415a98c2120a | 7,552 | py | Python | guild/vcs_util.py | guildai/guild-python2 | 8f83e8234fc4b268b6f29ca7d0f1b93148e4d2a6 | [
"Apache-2.0"
] | null | null | null | guild/vcs_util.py | guildai/guild-python2 | 8f83e8234fc4b268b6f29ca7d0f1b93148e4d2a6 | [
"Apache-2.0"
] | null | null | null | guild/vcs_util.py | guildai/guild-python2 | 8f83e8234fc4b268b6f29ca7d0f1b93148e4d2a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2022 RStudio, PBC
#
# 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... | 29.046154 | 82 | 0.615996 |
import collections
import logging
import re
import os
import subprocess
from guild import util
class UnsupportedRepo(Exception):
pass
class Scheme:
def __init__(
self,
name,
commit_cmd,
commit_pattern,
commit_ok_errors,
status_cmd,
statu... | true | true |
1c1de1feb50e92ede06de0aab3c6b6290b743385 | 7,568 | py | Python | rlkit/torch/sac/sac.py | szk9876/rlkit | 9d8213884b8bc6722041e23ae4f717c6bc17596c | [
"MIT"
] | null | null | null | rlkit/torch/sac/sac.py | szk9876/rlkit | 9d8213884b8bc6722041e23ae4f717c6bc17596c | [
"MIT"
] | null | null | null | rlkit/torch/sac/sac.py | szk9876/rlkit | 9d8213884b8bc6722041e23ae4f717c6bc17596c | [
"MIT"
] | null | null | null | from collections import OrderedDict
import numpy as np
import torch.optim as optim
from torch import nn as nn
import rlkit.torch.pytorch_util as ptu
from rlkit.core.eval_util import create_stats_ordered_dict
from rlkit.torch.torch_rl_algorithm import TorchRLAlgorithm
from rlkit.torch.sac.policies import MakeDetermini... | 33.486726 | 147 | 0.587738 | from collections import OrderedDict
import numpy as np
import torch.optim as optim
from torch import nn as nn
import rlkit.torch.pytorch_util as ptu
from rlkit.core.eval_util import create_stats_ordered_dict
from rlkit.torch.torch_rl_algorithm import TorchRLAlgorithm
from rlkit.torch.sac.policies import MakeDetermini... | true | true |
1c1de294dcbc76dff5b1396fa86586d42c455d24 | 1,577 | py | Python | hmc_shared/utils/http.py | ShAlireza/hwc_shared | ffd4ce67752d4547c501de19eae8df2c3cc9598b | [
"MIT"
] | null | null | null | hmc_shared/utils/http.py | ShAlireza/hwc_shared | ffd4ce67752d4547c501de19eae8df2c3cc9598b | [
"MIT"
] | null | null | null | hmc_shared/utils/http.py | ShAlireza/hwc_shared | ffd4ce67752d4547c501de19eae8df2c3cc9598b | [
"MIT"
] | null | null | null | import requests
from typing import Union, Any, Tuple, Dict
from torpy.http.requests import TorRequests
def request(
method: str,
url: str,
params: Dict[str, Union[str, int, float]] = None,
json: Dict[str, Any] = None,
headers: Dict[str, Union[str, int, float]] = None,
... | 29.203704 | 63 | 0.49461 | import requests
from typing import Union, Any, Tuple, Dict
from torpy.http.requests import TorRequests
def request(
method: str,
url: str,
params: Dict[str, Union[str, int, float]] = None,
json: Dict[str, Any] = None,
headers: Dict[str, Union[str, int, float]] = None,
... | true | true |
1c1de31001276badc7412fb06bd7f459bb182576 | 2,824 | py | Python | src/blackjack/firstAI.py | Broderick-Westrope/Blackjack | b88ccd639ad8e5fdde8e4099b1ed1dbfa73f878b | [
"MIT"
] | null | null | null | src/blackjack/firstAI.py | Broderick-Westrope/Blackjack | b88ccd639ad8e5fdde8e4099b1ed1dbfa73f878b | [
"MIT"
] | null | null | null | src/blackjack/firstAI.py | Broderick-Westrope/Blackjack | b88ccd639ad8e5fdde8e4099b1ed1dbfa73f878b | [
"MIT"
] | null | null | null | from utilities import clearCLI
from person import Person
from game import Game
class FirstAI(Person):
def __init__(self, name, value, decks):
super().__init__(name, value)
self.decks = decks
self.runningCount = 0
self.trueCount = 0
def takeTurn(self, game):
if game.deal... | 36.205128 | 204 | 0.517705 | from utilities import clearCLI
from person import Person
from game import Game
class FirstAI(Person):
def __init__(self, name, value, decks):
super().__init__(name, value)
self.decks = decks
self.runningCount = 0
self.trueCount = 0
def takeTurn(self, game):
if game.deal... | true | true |
1c1de3ab9d10dc57aee4d4c38f702813d25bc43c | 2,784 | py | Python | Wrappers/Python/test/test_DataProcessor.py | epapoutsellis/CCPi-Dynamic | d108cd7e9652992001a116347941eda7e75b3301 | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/test/test_DataProcessor.py | epapoutsellis/CCPi-Dynamic | d108cd7e9652992001a116347941eda7e75b3301 | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/test/test_DataProcessor.py | epapoutsellis/CCPi-Dynamic | d108cd7e9652992001a116347941eda7e75b3301 | [
"Apache-2.0"
] | null | null | null | import sys
import unittest
import numpy
from ccpi.framework import DataProcessor
from ccpi.framework import DataContainer
from ccpi.framework import ImageData
from ccpi.framework import AcquisitionData
from ccpi.framework import ImageGeometry
from ccpi.framework import AcquisitionGeometry
from timeit import de... | 36.631579 | 105 | 0.575072 | import sys
import unittest
import numpy
from ccpi.framework import DataProcessor
from ccpi.framework import DataContainer
from ccpi.framework import ImageData
from ccpi.framework import AcquisitionData
from ccpi.framework import ImageGeometry
from ccpi.framework import AcquisitionGeometry
from timeit import de... | true | true |
1c1de3eaf5fae1a89fe60a9adf6a6bab780d44b8 | 660 | py | Python | tests/v2/test_1192-iterables-in-__array_function__.py | douglasdavis/awkward-1.0 | f00775803a5568efb0a8e2dae3b1a4f23228fa40 | [
"BSD-3-Clause"
] | null | null | null | tests/v2/test_1192-iterables-in-__array_function__.py | douglasdavis/awkward-1.0 | f00775803a5568efb0a8e2dae3b1a4f23228fa40 | [
"BSD-3-Clause"
] | null | null | null | tests/v2/test_1192-iterables-in-__array_function__.py | douglasdavis/awkward-1.0 | f00775803a5568efb0a8e2dae3b1a4f23228fa40 | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
to_list = ak._v2.operations.convert.to_list
def test():
first = ak._v2.operations.convert.from_numpy(np.array([1, 2, 3]))
de... | 31.428571 | 87 | 0.581818 |
import pytest
import numpy as np
import awkward as ak
to_list = ak._v2.operations.convert.to_list
def test():
first = ak._v2.operations.convert.from_numpy(np.array([1, 2, 3]))
deltas = ak._v2.highlevel.Array([[1, 2], [1, 2], [1, 2, 3]])
assert np.hstack(
(
first[:, np.newaxis]... | true | true |
1c1de4544b4da22ed609574f9ceaf6d742bb9a5e | 5,672 | py | Python | setup.py | iljah/PyBitmessage | 5dbe832a1a4fde5d67ec9d13631a2d6733d47730 | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | null | null | null | setup.py | iljah/PyBitmessage | 5dbe832a1a4fde5d67ec9d13631a2d6733d47730 | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | null | null | null | setup.py | iljah/PyBitmessage | 5dbe832a1a4fde5d67ec9d13631a2d6733d47730 | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | null | null | null | #!/usr/bin/env python2.7
import os
import platform
import shutil
import sys
from setuptools import setup, Extension
from setuptools.command.install import install
from src.version import softwareVersion
EXTRAS_REQUIRE = {
'docs': ['sphinx', 'sphinxcontrib-apidoc', 'm2r'],
'gir': ['pygobject'],
'json': ... | 31.865169 | 78 | 0.56012 |
import os
import platform
import shutil
import sys
from setuptools import setup, Extension
from setuptools.command.install import install
from src.version import softwareVersion
EXTRAS_REQUIRE = {
'docs': ['sphinx', 'sphinxcontrib-apidoc', 'm2r'],
'gir': ['pygobject'],
'json': ['jsonrpclib'],
'not... | true | true |
1c1de45ac89fefdb371cb932a897970c8a27cf5b | 15,007 | py | Python | tensorflow_probability/python/distributions/mvn_linear_operator.py | hendriksanta/probability | 6eedc0f01a539b3bee7be28ccd2a9cce15d92f7f | [
"Apache-2.0"
] | 1 | 2020-01-16T02:19:34.000Z | 2020-01-16T02:19:34.000Z | tensorflow_probability/python/distributions/mvn_linear_operator.py | hendriksanta/probability | 6eedc0f01a539b3bee7be28ccd2a9cce15d92f7f | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/mvn_linear_operator.py | hendriksanta/probability | 6eedc0f01a539b3bee7be28ccd2a9cce15d92f7f | [
"Apache-2.0"
] | 1 | 2020-10-19T11:24:40.000Z | 2020-10-19T11:24:40.000Z | # Copyright 2018 The TensorFlow Probability 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 o... | 37.42394 | 101 | 0.666556 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.bijectors import identity as identity_bijector
from tensorflow_probability.python.bijectors import scale_matvec_linear_operat... | true | true |
1c1de4764e968c082087f8f2de2bda3f693d67ea | 22,312 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policy_definitions_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policy_definitions_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policy_definitions_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.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 may ... | 52.622642 | 285 | 0.693214 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse... | true | true |
1c1de509dc7edecab3443ba4e135e3c6c0b30e6e | 21,431 | py | Python | sharppy/sharptab/watch_type.py | ebaals/Thesis | c48b5219195fd30082ce3cfee478fc2a1c69d162 | [
"BSD-3-Clause"
] | 3 | 2015-07-01T17:52:13.000Z | 2017-05-23T19:49:16.000Z | sharppy/sharptab/watch_type.py | jamayfieldjr/SHARPpy | 988bba5626b01599b6414a6a196ba22371a4fb89 | [
"BSD-3-Clause"
] | null | null | null | sharppy/sharptab/watch_type.py | jamayfieldjr/SHARPpy | 988bba5626b01599b6414a6a196ba22371a4fb89 | [
"BSD-3-Clause"
] | 1 | 2015-07-01T17:55:45.000Z | 2015-07-01T17:55:45.000Z | from sharppy.sharptab import thermo, utils, interp, params, constants
import numpy as np
## Routines implemented in Python by Greg Blumberg - CIMMS and Kelton Halbert (OU SoM)
## wblumberg@ou.edu, greg.blumberg@noaa.gov, kelton.halbert@noaa.gov, keltonhalbert@ou.edu
def wind_chill(prof):
'''
Surface Wind ... | 35.54063 | 140 | 0.596379 | from sharppy.sharptab import thermo, utils, interp, params, constants
import numpy as np
*sfc_temp) - (35.75*(sfc_wspd**0.16)) + \
0.4275 * (sfc_temp) * (sfc_wspd**0.16)
return wind_chill
def init_phase(prof):
plevel = 0
phase = -1
avail = np.ma.where(prof.omeg < .1)[... | true | true |
1c1de66e3062ca39560c047ff2a4df9312290bc2 | 2,096 | py | Python | qmpy/web/views/analysis/visualize.py | JosephMontoya-TRI/qmpy | 5a5aa7b25b1231801969ea042bbd2309cacc7859 | [
"MIT"
] | 1 | 2019-11-15T20:54:04.000Z | 2019-11-15T20:54:04.000Z | qmpy/web/views/analysis/visualize.py | JosephMontoya-TRI/qmpy_py3 | 5a5aa7b25b1231801969ea042bbd2309cacc7859 | [
"MIT"
] | null | null | null | qmpy/web/views/analysis/visualize.py | JosephMontoya-TRI/qmpy_py3 | 5a5aa7b25b1231801969ea042bbd2309cacc7859 | [
"MIT"
] | null | null | null | from tempfile import mkstemp
import os.path
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.core.context_processors import csrf
import io
from qmpy import *
from ..tools import get_globals
global custom_data
custom_data = Non... | 26.2 | 60 | 0.716126 | from tempfile import mkstemp
import os.path
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.core.context_processors import csrf
import io
from qmpy import *
from ..tools import get_globals
global custom_data
custom_data = Non... | true | true |
1c1de7a29fca125d949b2e85ee95cc0179d29005 | 673 | py | Python | backend/core/config.py | zy7y/watch-fastapi | f679c6694ac99c77352adee833416321ee3c3a9d | [
"MIT"
] | 20 | 2021-11-08T01:37:00.000Z | 2022-03-28T03:03:06.000Z | backend/core/config.py | ilfish/watch-fastapi | 926f3eada2acde40cf0a43d386215a65548666f6 | [
"MIT"
] | 1 | 2022-03-26T08:24:26.000Z | 2022-03-26T08:26:20.000Z | backend/core/config.py | ilfish/watch-fastapi | 926f3eada2acde40cf0a43d386215a65548666f6 | [
"MIT"
] | 10 | 2021-11-07T04:02:12.000Z | 2022-03-20T06:28:04.000Z | import secrets
from typing import Optional
from pydantic import BaseSettings
class Settings(BaseSettings):
TITLE: Optional[str] = "电影列表接口"
DESC: Optional[str] = """
- 电影列表项目,基于Hello Flask 一书中的 实战项目
- 实现: FastAPI ....
"""
# JWT
# token相关
ALGORITHM: str = "HS256" # 加密算法
SECRET_K... | 20.393939 | 80 | 0.583952 | import secrets
from typing import Optional
from pydantic import BaseSettings
class Settings(BaseSettings):
TITLE: Optional[str] = "电影列表接口"
DESC: Optional[str] = """
- 电影列表项目,基于Hello Flask 一书中的 实战项目
- 实现: FastAPI ....
"""
ALGORITHM: str = "HS256"
SECRET_KEY: str = secrets.to... | true | true |
1c1de7c0969618ffd510f4e4cb2d718ba1a80da7 | 14,255 | py | Python | BeautifulReport/BeautifulReport.py | dasu23/BeautifulReport | 4698306c7b8b84774033e18842394a623e84a7b0 | [
"MIT"
] | 17 | 2019-03-23T15:17:05.000Z | 2022-01-26T08:20:07.000Z | BeautifulReport/BeautifulReport.py | dasu23/BeautifulReport | 4698306c7b8b84774033e18842394a623e84a7b0 | [
"MIT"
] | 8 | 2019-07-04T03:57:50.000Z | 2022-02-10T09:41:40.000Z | BeautifulReport/BeautifulReport.py | dasu23/BeautifulReport | 4698306c7b8b84774033e18842394a623e84a7b0 | [
"MIT"
] | 13 | 2019-07-04T03:36:43.000Z | 2022-03-08T06:26:57.000Z | """
@Project: BeautifulReport
@Author: Raymond Mocobk
@Data: 2019/03/20
@File: __init__.py.py
@License: MIT
"""
import os
import sys
from io import StringIO as StringIO
import time
import json
import unittest
import platform
import base64
from distutils.sysconfig import get_python_lib
import traceback
from functools i... | 30.329787 | 110 | 0.556998 |
import os
import sys
from io import StringIO as StringIO
import time
import json
import unittest
import platform
import base64
from distutils.sysconfig import get_python_lib
import traceback
from functools import wraps
__all__ = ['BeautifulReport']
HTML_IMG_TEMPLATE = """
<a href="data:image/png;base64, {}">
... | true | true |
1c1de8c6ceb33b16af15052564ad9034c87be6fd | 89 | py | Python | apploja/apps.py | pmela/lojapam | db4b7c99b8dc374358e1239ce0ced66e16f5736a | [
"MIT"
] | 2 | 2020-07-17T17:13:53.000Z | 2020-12-04T05:42:58.000Z | apploja/apps.py | pmela/lojapam | db4b7c99b8dc374358e1239ce0ced66e16f5736a | [
"MIT"
] | 16 | 2020-07-12T04:00:52.000Z | 2021-01-20T20:22:52.000Z | apploja/apps.py | pmela/lojapam | db4b7c99b8dc374358e1239ce0ced66e16f5736a | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ApplojaConfig(AppConfig):
name = 'apploja'
| 14.833333 | 33 | 0.752809 | from django.apps import AppConfig
class ApplojaConfig(AppConfig):
name = 'apploja'
| true | true |
1c1de94be041c173a0848544bb8e2bd31dd2cb46 | 1,312 | py | Python | scripts/run_ssm.py | nismod/microsimulation | 37ce2843f10b83a8e7a225c801cec83b85e6e0d0 | [
"MIT"
] | 9 | 2019-02-07T00:54:11.000Z | 2022-01-27T10:32:23.000Z | scripts/run_ssm.py | nismod/microsimulation | 37ce2843f10b83a8e7a225c801cec83b85e6e0d0 | [
"MIT"
] | 22 | 2017-12-18T15:10:58.000Z | 2022-03-23T20:16:04.000Z | scripts/run_ssm.py | nismod/microsimulation | 37ce2843f10b83a8e7a225c801cec83b85e6e0d0 | [
"MIT"
] | 4 | 2019-04-26T14:48:07.000Z | 2021-07-07T09:44:40.000Z | #!/usr/bin/env python3
""" run script for static sequential microsynthesis """
import time
import microsimulation.static as Static
import microsimulation.utils as utils
#assert humanleague.version() > 1
DEFAULT_CACHE_DIR = "./cache"
DEFAULT_OUTPUT_DIR = "./data"
def main(params):
""" Run it """
resolution = pa... | 27.914894 | 121 | 0.70122 |
import time
import microsimulation.static as Static
import microsimulation.utils as utils
DEFAULT_CACHE_DIR = "./cache"
DEFAULT_OUTPUT_DIR = "./data"
def main(params):
resolution = params["resolution"]
ref_year = params["census_ref_year"]
horizon_year = params["horizon_year"]
is_custom = params.get("cust... | true | true |
1c1deafcd45f66b31fff1892a7ea1c7aef9dafe2 | 6,456 | py | Python | mlrun/api/api/endpoints/runs.py | Hedingber/mlrun | e2269718fcc7caa7e1aa379ac28495830b45f9da | [
"Apache-2.0"
] | null | null | null | mlrun/api/api/endpoints/runs.py | Hedingber/mlrun | e2269718fcc7caa7e1aa379ac28495830b45f9da | [
"Apache-2.0"
] | null | null | null | mlrun/api/api/endpoints/runs.py | Hedingber/mlrun | e2269718fcc7caa7e1aa379ac28495830b45f9da | [
"Apache-2.0"
] | null | null | null | import datetime
from http import HTTPStatus
from typing import List
from fastapi import APIRouter, Depends, Query, Request
from fastapi.concurrency import run_in_threadpool
from sqlalchemy.orm import Session
import mlrun.api.crud
import mlrun.api.schemas
import mlrun.api.utils.clients.opa
import mlrun.api.utils.singl... | 30.027907 | 97 | 0.662949 | import datetime
from http import HTTPStatus
from typing import List
from fastapi import APIRouter, Depends, Query, Request
from fastapi.concurrency import run_in_threadpool
from sqlalchemy.orm import Session
import mlrun.api.crud
import mlrun.api.schemas
import mlrun.api.utils.clients.opa
import mlrun.api.utils.singl... | true | true |
1c1debc7a55dd716b18b856e214928bea8614530 | 2,576 | py | Python | Exareme-Docker/src/mip-algorithms/LOGISTIC_REGRESSION/step/1/local.py | crochat/exareme | 94c0ab79b0096a2bac65b13bdf975ff6bbebfea2 | [
"MIT"
] | null | null | null | Exareme-Docker/src/mip-algorithms/LOGISTIC_REGRESSION/step/1/local.py | crochat/exareme | 94c0ab79b0096a2bac65b13bdf975ff6bbebfea2 | [
"MIT"
] | null | null | null | Exareme-Docker/src/mip-algorithms/LOGISTIC_REGRESSION/step/1/local.py | crochat/exareme | 94c0ab79b0096a2bac65b13bdf975ff6bbebfea2 | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
from os import path
from argparse import ArgumentParser
import numpy as np
from scipy.special import expit
sys.path.append(path.dirname(path.dirname(path.dirname(path.dirname(path.abspath(__file__)... | 31.414634 | 107 | 0.661102 | from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
from os import path
from argparse import ArgumentParser
import numpy as np
from scipy.special import expit
sys.path.append(path.dirname(path.dirname(path.dirname(path.dirname(path.abspath(__file__)... | true | true |
1c1dec570e28e02e99fc131ed874ee2faede7afe | 4,002 | py | Python | functions/source/OpenShiftResource/src/awsqs_openshift_manager/models.py | guruantree/kolaborasi | a17a2ed2ae610d3b8f705eff820b58b0820e3051 | [
"Apache-2.0"
] | 179 | 2017-09-13T20:52:00.000Z | 2022-03-24T19:18:19.000Z | functions/source/OpenShiftResource/src/awsqs_openshift_manager/models.py | guruantree/kolaborasi | a17a2ed2ae610d3b8f705eff820b58b0820e3051 | [
"Apache-2.0"
] | 248 | 2017-09-13T20:11:40.000Z | 2022-03-30T07:30:40.000Z | functions/source/OpenShiftResource/src/awsqs_openshift_manager/models.py | guruantree/kolaborasi | a17a2ed2ae610d3b8f705eff820b58b0820e3051 | [
"Apache-2.0"
] | 216 | 2017-09-14T19:46:22.000Z | 2022-03-29T22:19:20.000Z | # DO NOT modify this file by hand, changes will be overwritten
import sys
from dataclasses import dataclass
from inspect import getmembers, isclass
from typing import (
AbstractSet,
Any,
Generic,
Mapping,
MutableMapping,
Optional,
Sequence,
Type,
TypeVar,
)
from cloudformation_cli_p... | 35.732143 | 99 | 0.709645 |
import sys
from dataclasses import dataclass
from inspect import getmembers, isclass
from typing import (
AbstractSet,
Any,
Generic,
Mapping,
MutableMapping,
Optional,
Sequence,
Type,
TypeVar,
)
from cloudformation_cli_python_lib.interface import (
BaseModel,
BaseResourceHa... | true | true |
1c1dec672596abaf58749e4301093b5b22ff3824 | 2,856 | py | Python | qa/rpc-tests/blockchain.py | lipcoin/lipcoin | 7afc0a02d63620e5a5601474cca131cb0cf3bbe4 | [
"MIT"
] | null | null | null | qa/rpc-tests/blockchain.py | lipcoin/lipcoin | 7afc0a02d63620e5a5601474cca131cb0cf3bbe4 | [
"MIT"
] | null | null | null | qa/rpc-tests/blockchain.py | lipcoin/lipcoin | 7afc0a02d63620e5a5601474cca131cb0cf3bbe4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The LipCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test RPC calls related to blockchain state. Tests correspond to code in
# rpc/blockchain.cpp.
#
from... | 31.733333 | 73 | 0.678221 |
from decimal import Decimal
from test_framework.test_framework import LipCoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import (
assert_equal,
assert_raises,
assert_is_hex_string,
assert_is_hash_string,
start_nodes,
connect_nodes_bi,
)... | true | true |
1c1dece7e65af7fff23f8dac84ac70831f04021b | 6,333 | py | Python | src/data_loader/utils.py | Sathya98/MGP-HATCN | d4719d2519861a873ab71ce70943d32e2b54e36b | [
"MIT"
] | 11 | 2020-09-09T04:21:05.000Z | 2022-02-21T16:34:37.000Z | src/data_loader/utils.py | Sathya98/MGP-HATCN | d4719d2519861a873ab71ce70943d32e2b54e36b | [
"MIT"
] | 5 | 2021-02-26T18:20:44.000Z | 2022-02-10T03:37:55.000Z | src/data_loader/utils.py | Sathya98/MGP-HATCN | d4719d2519861a873ab71ce70943d32e2b54e36b | [
"MIT"
] | 7 | 2020-08-15T12:19:35.000Z | 2022-02-21T16:34:44.000Z | import numpy as np
def reduce_data(X, n_max=None, n_min=None):
# data = [Y, T, ind_Y, len_T, X, len_X, labels, ids, static, onset_h]
# data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
n_removed = 0
X = [np.asarray(X[i]) for i in range(len(X))]
if n_max is not None:
idx_t... | 35.578652 | 104 | 0.56924 | import numpy as np
def reduce_data(X, n_max=None, n_min=None):
n_removed = 0
X = [np.asarray(X[i]) for i in range(len(X))]
if n_max is not None:
idx_to_reduce = np.where(X[3] >= n_max)
for pat_no in idx_to_reduce[0]:
for data_no in range(3):
... | true | true |
1c1decff705bcbd4fef57190cd3f9e0900740d7f | 1,463 | py | Python | misc/legacy/fermions/yaferp/general/denseTrotter.py | wmkirby1/CS-VQE | 9a0a7634dcb77f064957c772cf229b7103cce3a8 | [
"Apache-2.0"
] | 1 | 2021-11-10T18:03:49.000Z | 2021-11-10T18:03:49.000Z | misc/legacy/fermions/yaferp/general/denseTrotter.py | wmkirby1/CS-VQE | 9a0a7634dcb77f064957c772cf229b7103cce3a8 | [
"Apache-2.0"
] | null | null | null | misc/legacy/fermions/yaferp/general/denseTrotter.py | wmkirby1/CS-VQE | 9a0a7634dcb77f064957c772cf229b7103cce3a8 | [
"Apache-2.0"
] | 1 | 2021-11-09T13:20:07.000Z | 2021-11-09T13:20:07.000Z | '''
denseTrotter
Created on 21 May 2015
summary: trotterise things as dense matrices - for VERY small hamiltonians only (no more than 12 qubits or so) (!!!!!!!!)
@author: andrew
'''
from yaferp.general import denseFermions
import scipy.linalg
def oplistToMatrices(oplist):
'''return a list of matrix representation... | 41.8 | 122 | 0.738893 | from yaferp.general import denseFermions
import scipy.linalg
def oplistToMatrices(oplist):
listMatrices = []
for op in oplist:
listMatrices.append(denseFermions.commutingOplistToMatrix(op))
return listMatrices
def unitaryManual(hamiltonian,time):
exponent = hamiltonian * time * -1.j
unitar... | true | true |
1c1ded7e28dacc31d5cc9989abc027bcd1c7d929 | 240 | py | Python | app/api/v1/common/ping.py | sumitsawant/electionguard-api-python | 17d98336b7188a446fa2746a531a04f25b9edd1a | [
"MIT"
] | 19 | 2020-02-05T17:57:41.000Z | 2021-03-27T06:21:20.000Z | app/api/v1/common/ping.py | QPC-database/electionguard-api-python | bee0f8d2e4982df6e11d09322065e22ebd26e2c2 | [
"MIT"
] | 74 | 2021-04-21T15:10:31.000Z | 2022-03-30T15:04:39.000Z | app/api/v1/common/ping.py | QPC-database/electionguard-api-python | bee0f8d2e4982df6e11d09322065e22ebd26e2c2 | [
"MIT"
] | 17 | 2021-05-29T10:00:05.000Z | 2022-03-25T02:57:24.000Z | from typing import Any
from fastapi import APIRouter
from ..tags import UTILITY
router = APIRouter()
@router.get("", response_model=str, tags=[UTILITY])
def ping() -> Any:
"""
Ensure API can be pinged
"""
return "pong"
| 15 | 51 | 0.658333 | from typing import Any
from fastapi import APIRouter
from ..tags import UTILITY
router = APIRouter()
@router.get("", response_model=str, tags=[UTILITY])
def ping() -> Any:
return "pong"
| true | true |
1c1dedf39fe6dc5699a4c853819ee52593d3f99b | 3,739 | py | Python | app/UserInterface.py | icterguru/BiBlerUnittests | e109657677cdafcadaf7c263cf35e222cae151b6 | [
"Apache-2.0"
] | null | null | null | app/UserInterface.py | icterguru/BiBlerUnittests | e109657677cdafcadaf7c263cf35e222cae151b6 | [
"Apache-2.0"
] | null | null | null | app/UserInterface.py | icterguru/BiBlerUnittests | e109657677cdafcadaf7c263cf35e222cae151b6 | [
"Apache-2.0"
] | null | null | null |
from RefManager import *
import RefManager
from gui.app_interface import IApplication
from gui.app_interface import EntryDict
from gui.app_interface import EntryListColumn
from utils import settings
class UserInterface(IApplication):
def __init__(self):
super(UserInterface, self).__init__()
self... | 26.707143 | 86 | 0.539717 |
from RefManager import *
import RefManager
from gui.app_interface import IApplication
from gui.app_interface import EntryDict
from gui.app_interface import EntryListColumn
from utils import settings
class UserInterface(IApplication):
def __init__(self):
super(UserInterface, self).__init__()
self... | true | true |
1c1deec5877b7295f12d4eff5fbc250059b4b1e9 | 17,604 | py | Python | statsmodels/stats/dist_dependence_measures.py | tmct/statsmodels | c8dcd233d870c6f96d55b6d06e94bb53b4de46ee | [
"BSD-3-Clause"
] | 1 | 2021-08-05T13:30:46.000Z | 2021-08-05T13:30:46.000Z | statsmodels/stats/dist_dependence_measures.py | barryquinn1/statsmodels | 305258f5245e76409f6deab24d217ffbbc352ba0 | [
"BSD-3-Clause"
] | null | null | null | statsmodels/stats/dist_dependence_measures.py | barryquinn1/statsmodels | 305258f5245e76409f6deab24d217ffbbc352ba0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
""" Distance dependence measure and the dCov test.
Implementation of Székely et al. (2007) calculation of distance
dependence statistics, including the Distance covariance (dCov) test
for independence of random vectors of arbitrary length.
Author: Ron Itzikovitch
References
----------
.. Szek... | 34.653543 | 78 | 0.640877 |
import numpy as np
import warnings
from collections import namedtuple
from scipy.spatial.distance import pdist, squareform
from scipy.stats import norm
DistDependStat = namedtuple(
"DistDependStat",
["test_statistic", "distance_correlation",
"distance_covariance", "dvar_x", "dvar_y", "S"],
)
def dist... | true | true |
1c1def13d5ecdc82faef17846d7be5a90634e3d7 | 2,341 | py | Python | scripts/run_all_em.py | megagonlabs/rotom | 09a9dd9ab672c6daa315ad0e077ccbe3612fa934 | [
"BSD-3-Clause"
] | 6 | 2021-06-05T07:23:00.000Z | 2022-03-10T11:56:22.000Z | scripts/run_all_em.py | megagonlabs/rotom | 09a9dd9ab672c6daa315ad0e077ccbe3612fa934 | [
"BSD-3-Clause"
] | null | null | null | scripts/run_all_em.py | megagonlabs/rotom | 09a9dd9ab672c6daa315ad0e077ccbe3612fa934 | [
"BSD-3-Clause"
] | null | null | null | datasets = """em_Amazon-Google
em_DBLP-ACM
em_DBLP-GoogleScholar
em_Walmart-Amazon
em_Abt-Buy
em_DBLP-ACM-dirty
em_DBLP-GoogleScholar-dirty
em_Walmart-Amazon-dirty""".split('\n')
result_path = 'results_em/'
sizes = [300, 450, 600, 750]
lm = 'roberta'
batch_size = 32
n_epochs_list = [20, 20, 20, 20]
import os
import t... | 27.22093 | 110 | 0.513883 | datasets = """em_Amazon-Google
em_DBLP-ACM
em_DBLP-GoogleScholar
em_Walmart-Amazon
em_Abt-Buy
em_DBLP-ACM-dirty
em_DBLP-GoogleScholar-dirty
em_Walmart-Amazon-dirty""".split('\n')
result_path = 'results_em/'
sizes = [300, 450, 600, 750]
lm = 'roberta'
batch_size = 32
n_epochs_list = [20, 20, 20, 20]
import os
import t... | true | true |
1c1df107bfb01731260a7be4840d7068357f449e | 588 | py | Python | Numeric Patterns/numericpattern289.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | null | null | null | Numeric Patterns/numericpattern289.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | 471 | 2022-01-15T07:07:18.000Z | 2022-02-28T16:01:42.000Z | Numeric Patterns/numericpattern289.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | 2 | 2022-01-17T09:43:16.000Z | 2022-01-29T15:15:47.000Z | height = int(input())
x = 1
for i in range(1,height+1):
for j in range(1,height+1):
if((j <= x or j > height-x) and j <= height//2):
print(j,end=" ")
elif((j <= x or j > height-x) and j > height//2):
print(height-j+1,end=" ")
else:
pri... | 17.818182 | 57 | 0.365646 | height = int(input())
x = 1
for i in range(1,height+1):
for j in range(1,height+1):
if((j <= x or j > height-x) and j <= height//2):
print(j,end=" ")
elif((j <= x or j > height-x) and j > height//2):
print(height-j+1,end=" ")
else:
pri... | true | true |
1c1df16f7abe0e457ddca3f907eeac5aa47410d1 | 444 | py | Python | jarm/formats/tls_1_2_reverse.py | andrew-paloalto/pyjarm | 3152621458482adc3a6c77963fddda2f00909dd7 | [
"0BSD"
] | 26 | 2021-01-16T13:16:32.000Z | 2022-03-29T07:45:09.000Z | jarm/formats/tls_1_2_reverse.py | andrew-paloalto/pyjarm | 3152621458482adc3a6c77963fddda2f00909dd7 | [
"0BSD"
] | 4 | 2021-01-29T09:28:43.000Z | 2021-05-29T15:16:57.000Z | jarm/formats/tls_1_2_reverse.py | andrew-paloalto/pyjarm | 3152621458482adc3a6c77963fddda2f00909dd7 | [
"0BSD"
] | 5 | 2021-01-15T17:09:28.000Z | 2021-10-16T19:17:33.000Z | from jarm.constants import TLS_1_2, ALL, REVERSE, FORWARD, SUPPORT_1_2
from jarm.formats.common import CommonTLSFormat
class TLS_1_2_Reverse(CommonTLSFormat):
def __init__(self):
super().__init__(
version=TLS_1_2,
cipher_list=ALL,
cipher_order=REVERSE,
is_gr... | 27.75 | 70 | 0.632883 | from jarm.constants import TLS_1_2, ALL, REVERSE, FORWARD, SUPPORT_1_2
from jarm.formats.common import CommonTLSFormat
class TLS_1_2_Reverse(CommonTLSFormat):
def __init__(self):
super().__init__(
version=TLS_1_2,
cipher_list=ALL,
cipher_order=REVERSE,
is_gr... | true | true |
1c1df3be1d238f0b654d3c2595489bf67bf726e3 | 2,297 | py | Python | test/selenium/src/lib/service/rest/query.py | HLD/ggrc-core | 9bdc0fc6ca9e252f4919db682d80e360d5581eb4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/selenium/src/lib/service/rest/query.py | HLD/ggrc-core | 9bdc0fc6ca9e252f4919db682d80e360d5581eb4 | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | test/selenium/src/lib/service/rest/query.py | HLD/ggrc-core | 9bdc0fc6ca9e252f4919db682d80e360d5581eb4 | [
"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>
"""Constants and methods for work with REST and QUERY API interactions."""
from lib.constants import value_aliases as alias
class Query(object):
"""Query API constants, templates, methods."""
# pylint: ... | 31.465753 | 79 | 0.511537 |
from lib.constants import value_aliases as alias
class Query(object):
@staticmethod
def expression_get_snapshoted_obj(obj_type, obj_id, parent_type, parent_id):
return {
"expression": {
"left": {
"left": {
"left": "child_type",
... | true | true |
1c1df3f69965237219423a1bea2d4357e00cb736 | 1,959 | py | Python | test/tests/generators.py | vinzenz/pyston | 211aa1dd5b163be7fbe0c0dac85c38b01c36afc2 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | test/tests/generators.py | vinzenz/pyston | 211aa1dd5b163be7fbe0c0dac85c38b01c36afc2 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | test/tests/generators.py | vinzenz/pyston | 211aa1dd5b163be7fbe0c0dac85c38b01c36afc2 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | def G1(i=0):
while True:
yield i
i += i
g1 = G1()
for i in range(5):
print g1.next()
print g1.__name__
def G2():
yield 1
yield 2
yield 3
g2a = G2()
g2b = G2()
print g2b.next()
print list(g2a)
print list(g2b)
print list(g2a)
print list(G2())
def G3(i=0):
while True:
... | 14.954198 | 53 | 0.553344 | def G1(i=0):
while True:
yield i
i += i
g1 = G1()
for i in range(5):
print g1.next()
print g1.__name__
def G2():
yield 1
yield 2
yield 3
g2a = G2()
g2b = G2()
print g2b.next()
print list(g2a)
print list(g2b)
print list(g2a)
print list(G2())
def G3(i=0):
while True:
... | false | true |
1c1df43830bf05282276abbc18fb01b35f5af9d1 | 2,854 | py | Python | create_demopage_NL.py | shreyas253/SpStyleConv_CycleGAN | 5f5d21377e51bdbb79ac91dc29e595f2aaa5df9f | [
"MIT"
] | null | null | null | create_demopage_NL.py | shreyas253/SpStyleConv_CycleGAN | 5f5d21377e51bdbb79ac91dc29e595f2aaa5df9f | [
"MIT"
] | null | null | null | create_demopage_NL.py | shreyas253/SpStyleConv_CycleGAN | 5f5d21377e51bdbb79ac91dc29e595f2aaa5df9f | [
"MIT"
] | null | null | null | import os
import glob
import argparse
methods = [ "./audio/Norm_orig",
"./audio/Lomb_pred_parallel",
"./audio/Lomb_pred_inca",
"./audio/Lomb_pred_conv",
"./audio/Lomb_orig"
]
method_titles = ['Normal Reference',
'Mapped Parallel',
... | 25.482143 | 86 | 0.508059 | import os
import glob
import argparse
methods = [ "./audio/Norm_orig",
"./audio/Lomb_pred_parallel",
"./audio/Lomb_pred_inca",
"./audio/Lomb_pred_conv",
"./audio/Lomb_orig"
]
method_titles = ['Normal Reference',
'Mapped Parallel',
... | true | true |
1c1df43bca91b36d99f09e8e45dcf5e3dae94892 | 40,118 | py | Python | test/functional/test_framework/messages.py | KingricharVD/DSW | 7281f6ed5c102687805d2bca707e675cbce7dd4d | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | KingricharVD/DSW | 7281f6ed5c102687805d2bca707e675cbce7dd4d | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | KingricharVD/DSW | 7281f6ed5c102687805d2bca707e675cbce7dd4d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... | 29.390476 | 262 | 0.594646 |
from codecs import encode
import copy
import hashlib
from io import BytesIO
import random
import socket
import struct
import time
from test_framework.siphash import siphash256
from test_framework.util import hex_str_to_bytes, bytes_to_hex_str
MIN_VERSION_SUPPORTED = 60001
MY_VERSION = 70918
MY_SUBVERSION = b"/p... | true | true |
1c1df458053880590f4ea1f37a0320548655eb40 | 5,577 | py | Python | fugue_dask/_io.py | kvnkho/fugue | 5f3fe8f1fb72632e5b5987d720c1d1ef546e4682 | [
"Apache-2.0"
] | 547 | 2020-09-22T08:30:14.000Z | 2022-03-30T23:11:05.000Z | fugue_dask/_io.py | kvnkho/fugue | 5f3fe8f1fb72632e5b5987d720c1d1ef546e4682 | [
"Apache-2.0"
] | 196 | 2020-09-22T23:08:26.000Z | 2022-03-26T21:22:48.000Z | fugue_dask/_io.py | kvnkho/fugue | 5f3fe8f1fb72632e5b5987d720c1d1ef546e4682 | [
"Apache-2.0"
] | 37 | 2020-09-23T17:05:00.000Z | 2022-03-29T18:26:52.000Z | import os
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from dask import dataframe as dd
from fugue._utils.io import FileParser
from fugue._utils.io import _load_avro as _pd_load_avro
from fugue._utils.io import _save_avro, _get_single_files
from triad.collections.dict import ParamDict
from tria... | 31.508475 | 84 | 0.633674 | import os
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from dask import dataframe as dd
from fugue._utils.io import FileParser
from fugue._utils.io import _load_avro as _pd_load_avro
from fugue._utils.io import _save_avro, _get_single_files
from triad.collections.dict import ParamDict
from tria... | true | true |
1c1df469fff8884f4540c2a725f050d72e1aca75 | 2,228 | py | Python | airl_state_scripts/no_transfer_scripts/pendulum_irl_state_action.py | hsilva664/nstep_airl | c08650d8fddf6a27081d2b63cb8f9eb23d746b6c | [
"MIT"
] | 1 | 2020-05-02T14:32:42.000Z | 2020-05-02T14:32:42.000Z | airl_state_scripts/no_transfer_scripts/pendulum_irl_state_action.py | hsilva664/nstep_airl | c08650d8fddf6a27081d2b63cb8f9eb23d746b6c | [
"MIT"
] | null | null | null | airl_state_scripts/no_transfer_scripts/pendulum_irl_state_action.py | hsilva664/nstep_airl | c08650d8fddf6a27081d2b63cb8f9eb23d746b6c | [
"MIT"
] | null | null | null | import tensorflow as tf
from sandbox.rocky.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
from sandbox.rocky.tf.envs.base import TfEnv
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.envs.gym_env import GymEnv
from inverse_rl.algos.irl_trpo import IRLTRPO
from inverse_r... | 38.413793 | 121 | 0.739677 | import tensorflow as tf
from sandbox.rocky.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
from sandbox.rocky.tf.envs.base import TfEnv
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.envs.gym_env import GymEnv
from inverse_rl.algos.irl_trpo import IRLTRPO
from inverse_r... | true | true |
1c1df4d8ee602c85ffe094ae0285865284808d1f | 4,431 | py | Python | blender/render_utils.py | JasonQSY/Associative3D | c50818b593ec48c38ed7ee3e109c23531089da32 | [
"MIT"
] | 25 | 2020-08-26T02:41:12.000Z | 2021-09-30T21:50:36.000Z | blender/render_utils.py | JasonQSY/Associative3D | c50818b593ec48c38ed7ee3e109c23531089da32 | [
"MIT"
] | null | null | null | blender/render_utils.py | JasonQSY/Associative3D | c50818b593ec48c38ed7ee3e109c23531089da32 | [
"MIT"
] | 1 | 2020-11-17T15:25:26.000Z | 2020-11-17T15:25:26.000Z | import bpy
import math
import numpy as np
def get_calibration_matrix_K_from_blender(camd):
f_in_mm = camd.lens
scene = bpy.context.scene
resolution_x_in_px = scene.render.resolution_x
resolution_y_in_px = scene.render.resolution_y
scale = scene.render.resolution_percentage / 100
sensor_width_in... | 32.108696 | 86 | 0.556985 | import bpy
import math
import numpy as np
def get_calibration_matrix_K_from_blender(camd):
f_in_mm = camd.lens
scene = bpy.context.scene
resolution_x_in_px = scene.render.resolution_x
resolution_y_in_px = scene.render.resolution_y
scale = scene.render.resolution_percentage / 100
sensor_width_in... | true | true |
1c1df6d2d69bad7932473e7cd1c477e5850ba664 | 312 | py | Python | magical/__init__.py | Carreau/magical-magic | 36f49a490930e44e809a8841c2fbdc16b73d47fe | [
"BSD-3-Clause"
] | 2 | 2018-04-02T13:37:55.000Z | 2018-04-02T15:22:30.000Z | magical/__init__.py | Carreau/magical-magic | 36f49a490930e44e809a8841c2fbdc16b73d47fe | [
"BSD-3-Clause"
] | 1 | 2018-04-02T03:15:09.000Z | 2018-04-02T03:15:09.000Z | magical/__init__.py | Carreau/magical-magic | 36f49a490930e44e809a8841c2fbdc16b73d47fe | [
"BSD-3-Clause"
] | 1 | 2018-04-02T02:54:53.000Z | 2018-04-02T02:54:53.000Z | # coding: utf-8
# In[3]:
from magical.magic import magical
from magical.recipes import (
register_jinja2_magic,
register_mistune_magic,
register_yaml_magic
)
__version__ = "0.0.9"
magical
__all__ = [
'magical', 'register_jinja2_magic',
'register_mistune_magic', 'register_yaml_magic',
]
| 15.6 | 52 | 0.721154 |
from magical.magic import magical
from magical.recipes import (
register_jinja2_magic,
register_mistune_magic,
register_yaml_magic
)
__version__ = "0.0.9"
magical
__all__ = [
'magical', 'register_jinja2_magic',
'register_mistune_magic', 'register_yaml_magic',
]
| true | true |
1c1df79d510b4e3ac318eb9f5a6e49c8a12868f7 | 862 | py | Python | test/integration/modules/test_sfp_hunter.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | test/integration/modules/test_sfp_hunter.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | test/integration/modules/test_sfp_hunter.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | import pytest
import unittest
from modules.sfp_hunter import sfp_hunter
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget
@pytest.mark.usefixtures
class TestModuleIntegrationHunter(unittest.TestCase):
@unittest.skip("todo")
def test_handleEvent(self):
sf = SpiderF... | 26.121212 | 81 | 0.692575 | import pytest
import unittest
from modules.sfp_hunter import sfp_hunter
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget
@pytest.mark.usefixtures
class TestModuleIntegrationHunter(unittest.TestCase):
@unittest.skip("todo")
def test_handleEvent(self):
sf = SpiderF... | true | true |
1c1dfaaba1cb34bccd0de0db5e93481eb09c86bb | 6,432 | py | Python | detect.py | kkkris7/License-Plate-Detection---Deep-Learning | 31812cb21fc6fb4e8df8ed4427440d4628704e92 | [
"FTL"
] | null | null | null | detect.py | kkkris7/License-Plate-Detection---Deep-Learning | 31812cb21fc6fb4e8df8ed4427440d4628704e92 | [
"FTL"
] | null | null | null | detect.py | kkkris7/License-Plate-Detection---Deep-Learning | 31812cb21fc6fb4e8df8ed4427440d4628704e92 | [
"FTL"
] | null | null | null | import argparse
import shutil
import time
from pathlib import Path
from sys import platform
import moviepy.editor as mpe
import numpy as np
import os
from models import *
from utils.datasets import *
from utils.utils import *
import logging
def detect(
cfg,
weights,
images,
output='ou... | 34.212766 | 116 | 0.582556 | import argparse
import shutil
import time
from pathlib import Path
from sys import platform
import moviepy.editor as mpe
import numpy as np
import os
from models import *
from utils.datasets import *
from utils.utils import *
import logging
def detect(
cfg,
weights,
images,
output='ou... | true | true |
1c1dfabe0261dadb0f9cad73d554f93caed37706 | 1,183 | py | Python | tests/python/gaia-ui-tests/gaiatest/apps/homescreen/regions/permission_dialog.py | dlxswangli/gaia | 686cbb252f1ff4a0c2335dc507b05ded2ae90a0b | [
"Apache-2.0"
] | 1 | 2017-09-09T12:55:56.000Z | 2017-09-09T12:55:56.000Z | tests/python/gaia-ui-tests/gaiatest/apps/homescreen/regions/permission_dialog.py | dlxswangli/gaia | 686cbb252f1ff4a0c2335dc507b05ded2ae90a0b | [
"Apache-2.0"
] | 3 | 2016-09-10T15:41:48.000Z | 2016-09-10T15:42:41.000Z | tests/python/gaia-ui-tests/gaiatest/apps/homescreen/regions/permission_dialog.py | dlxswangli/gaia | 686cbb252f1ff4a0c2335dc507b05ded2ae90a0b | [
"Apache-2.0"
] | 1 | 2016-01-25T22:23:32.000Z | 2016-01-25T22:23:32.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette.by import By
from gaiatest.apps.base import Base
class PermissionDialog(Base):
_permission_dialog... | 39.433333 | 90 | 0.764159 |
from marionette.by import By
from gaiatest.apps.base import Base
class PermissionDialog(Base):
_permission_dialog_locator = (By.ID, 'permission-dialog')
_permission_dialog_message_locator = (By.ID, 'permission-message')
_permission_confirm_button_locator = (By.ID, 'permission-yes')
_permission_di... | true | true |
1c1dfb07c7e36fb5c6a11d02338525e5bb88135d | 4,445 | py | Python | tango_with_django_project/settings.py | martindes01/tango-with-django | 1b722666e586b9945257d90cc69b3d49788b424e | [
"MIT"
] | 2 | 2019-09-27T13:21:32.000Z | 2019-09-27T13:24:58.000Z | tango_with_django_project/settings.py | martindes01/tango-with-django | 1b722666e586b9945257d90cc69b3d49788b424e | [
"MIT"
] | null | null | null | tango_with_django_project/settings.py | martindes01/tango-with-django | 1b722666e586b9945257d90cc69b3d49788b424e | [
"MIT"
] | null | null | null | """
Django settings for tango_with_django_project project.
Generated by 'django-admin startproject' using Django 2.2.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/... | 24.97191 | 91 | 0.710911 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
MEDIA_DIR = os.path.join(BASE_DIR, 'media')
STATIC_DIR = os.path.join(BASE_DIR, 'static')
TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
SECRET_KEY = '4)r^%6b=a7^_8x%t^iqu*_!u)y*5#*8l0)rueb1p1bzqchbtau'
DEBUG = True
ALLOWED... | true | true |
1c1dfbccbc22d203c70f46985ec6644026eeab4d | 20,968 | py | Python | morpfw/crud/model.py | morpframework/morpfw | b867e5809d6c52e8839586670a29fcd179ce64c7 | [
"Apache-2.0"
] | 8 | 2018-12-08T01:41:58.000Z | 2020-12-21T15:30:12.000Z | morpfw/crud/model.py | morpframework/morpfw | b867e5809d6c52e8839586670a29fcd179ce64c7 | [
"Apache-2.0"
] | 17 | 2019-02-05T15:01:32.000Z | 2020-04-28T16:17:42.000Z | morpfw/crud/model.py | morpframework/morpfw | b867e5809d6c52e8839586670a29fcd179ce64c7 | [
"Apache-2.0"
] | 2 | 2018-12-08T05:03:37.000Z | 2019-03-20T07:15:21.000Z | import copy
import dataclasses
import json
import logging
import re
import warnings
from logging import warn
from uuid import uuid4
import morepath
import rulez
from DateTime import DateTime
from inverter import dc2colanderjson, dc2jsl
from jsonschema import ValidationError as JSLValidationError
from jsonschema import... | 32.916797 | 88 | 0.594 | import copy
import dataclasses
import json
import logging
import re
import warnings
from logging import warn
from uuid import uuid4
import morepath
import rulez
from DateTime import DateTime
from inverter import dc2colanderjson, dc2jsl
from jsonschema import ValidationError as JSLValidationError
from jsonschema import... | true | true |
1c1dfd083f62ff2abc85dcba2e1064bb323d4483 | 1,343 | py | Python | notion_extensions/base/props/block/embed.py | yuta0306/notion-extensions | 8a26f8c2abeef03a55c4d433439ce35ae5728a75 | [
"MIT"
] | 1 | 2022-01-12T15:53:43.000Z | 2022-01-12T15:53:43.000Z | notion_extensions/base/props/block/embed.py | yuta0306/notion-extensions | 8a26f8c2abeef03a55c4d433439ce35ae5728a75 | [
"MIT"
] | 1 | 2022-03-24T01:38:42.000Z | 2022-03-24T01:38:42.000Z | notion_extensions/base/props/block/embed.py | yuta0306/notion-extensions | 8a26f8c2abeef03a55c4d433439ce35ae5728a75 | [
"MIT"
] | null | null | null | from typing import Dict, Union
from .block import Block
__all__ = [
"Embed",
"EMBED_PLATFORMS",
]
EMBED_PLATFORMS = [
"Framer",
"Twitter (tweets)",
"Google Drive documents",
"Gist",
"Figma",
"Invision,",
"Loom",
"Typeform",
"Codepen",
"PDFs",
"Google Maps",
"Wh... | 16.7875 | 56 | 0.481757 | from typing import Dict, Union
from .block import Block
__all__ = [
"Embed",
"EMBED_PLATFORMS",
]
EMBED_PLATFORMS = [
"Framer",
"Twitter (tweets)",
"Google Drive documents",
"Gist",
"Figma",
"Invision,",
"Loom",
"Typeform",
"Codepen",
"PDFs",
"Google Maps",
"Wh... | true | true |
1c1dfd5c61fe8f1c8eccdca13ccb3356a80b61d0 | 621 | py | Python | rs_contents/views.py | RevSquare/rs_contents | 802f120257375692403e57b13f639c00509144a7 | [
"BSD-3-Clause"
] | null | null | null | rs_contents/views.py | RevSquare/rs_contents | 802f120257375692403e57b13f639c00509144a7 | [
"BSD-3-Clause"
] | null | null | null | rs_contents/views.py | RevSquare/rs_contents | 802f120257375692403e57b13f639c00509144a7 | [
"BSD-3-Clause"
] | null | null | null | from django.http import Http404
from django.views.generic import DetailView
from .preview.views import PreviewMix, preview_object
class ArticleDetailViewMix(PreviewMix, DetailView):
"""
Article detail view - for all models based on ContentPages
"""
template_name = 'contents/article.html'
def get... | 27 | 68 | 0.706924 | from django.http import Http404
from django.views.generic import DetailView
from .preview.views import PreviewMix, preview_object
class ArticleDetailViewMix(PreviewMix, DetailView):
template_name = 'contents/article.html'
def get_queryset(self):
return self.model.objects.all()
@preview_object
... | true | true |
1c1dfd5fbd77e261bdeed7d1c69b49c21f3d064d | 830 | py | Python | app/api/v2/routes.py | antonnifo/StackOverflow-lite | 77aaf52836127353795c58717be29f55f4b8c72a | [
"MIT"
] | 8 | 2019-01-23T10:47:43.000Z | 2019-02-26T13:54:23.000Z | app/api/v2/routes.py | antonnifo/StackOverflow-lite | 77aaf52836127353795c58717be29f55f4b8c72a | [
"MIT"
] | null | null | null | app/api/v2/routes.py | antonnifo/StackOverflow-lite | 77aaf52836127353795c58717be29f55f4b8c72a | [
"MIT"
] | 2 | 2019-02-26T09:59:15.000Z | 2019-09-20T17:02:06.000Z | """all for version 2 routes"""
from flask import Blueprint
from flask_restful import Api
from app.api.v2.users.views import UserSignUp, UserSignIn
from app.api.v2.questions.views import Questions, Question,UpdateQuestion
from app.api.v2.answers.views import Answers, Answer, AcceptAnswer
VERSION_DOS = Blueprint('apiv2... | 36.086957 | 73 | 0.789157 | from flask import Blueprint
from flask_restful import Api
from app.api.v2.users.views import UserSignUp, UserSignIn
from app.api.v2.questions.views import Questions, Question,UpdateQuestion
from app.api.v2.answers.views import Answers, Answer, AcceptAnswer
VERSION_DOS = Blueprint('apiv2', __name__, url_prefix='/api/v... | true | true |
1c1dff09aadf23bb6595adba864853bfc0375097 | 5,647 | py | Python | list_crawl/list_crawl.py | DigitalPebble/cc-quick-scripts | 9ee6e3b0cca25b28e3afea5fed80c12dc918e5f8 | [
"MIT"
] | 2 | 2017-04-12T19:34:48.000Z | 2017-04-16T10:41:28.000Z | list_crawl/list_crawl.py | DigitalPebble/cc-quick-scripts | 9ee6e3b0cca25b28e3afea5fed80c12dc918e5f8 | [
"MIT"
] | null | null | null | list_crawl/list_crawl.py | DigitalPebble/cc-quick-scripts | 9ee6e3b0cca25b28e3afea5fed80c12dc918e5f8 | [
"MIT"
] | 3 | 2016-04-04T21:54:49.000Z | 2019-10-31T11:08:56.000Z | import os
import sys
from collections import defaultdict
import boto3
s3client = boto3.client('s3')
# Since April 2016, the public dataset bucket is s3://commoncrawl/
# (migrated from s3://aws-publicdatasets/common-crawl/)
pds_bucket = 'commoncrawl'
# crawl name, eg. "CC-MAIN-2016-07"
target = str(sys.argv[1])
sy... | 36.198718 | 128 | 0.650965 | import os
import sys
from collections import defaultdict
import boto3
s3client = boto3.client('s3')
pds_bucket = 'commoncrawl'
target = str(sys.argv[1])
sys.stderr.write('Processing {}\n'.format(target))
cdx_bucket = None
if len(sys.argv) > 2:
print('Looking for cdx files in s3://{}/{}/cdx/'.format(sys.ar... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.