hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9596d899ce53b152e386300633dddb2660adaa0c | 6,442 | py | Python | openCV Lanes/Curved Lanes/ImagePrep.py | TheGupta2012/Lane-Detection | 4fa75bf4d3eeb8e4ca95e2bf680f999b68764158 | [
"MIT"
] | null | null | null | openCV Lanes/Curved Lanes/ImagePrep.py | TheGupta2012/Lane-Detection | 4fa75bf4d3eeb8e4ca95e2bf680f999b68764158 | [
"MIT"
] | null | null | null | openCV Lanes/Curved Lanes/ImagePrep.py | TheGupta2012/Lane-Detection | 4fa75bf4d3eeb8e4ca95e2bf680f999b68764158 | [
"MIT"
] | null | null | null | import cv2 as cv
import numpy as np
class PrepareImage():
'''ATTRIBUTES:
gauss_size : kernel size for the gaussian blur
type-> tuple of size 2 with odd and equal
entries > 1
gauss_deviation : x and y axis standard deviations for
gaussian blur
... | 42.104575 | 120 | 0.571096 |
a942fc97b7dfd6b1334d64576b3efe1435e21f51 | 2,699 | py | Python | loica/colony.py | SynBioUC/LOICA | b5eee507b42572cde85230c32933e1196ca4002e | [
"MIT"
] | 1 | 2020-11-16T22:40:30.000Z | 2020-11-16T22:40:30.000Z | loica/colony.py | SynBioUC/LOICA | b5eee507b42572cde85230c32933e1196ca4002e | [
"MIT"
] | 25 | 2020-09-12T22:26:01.000Z | 2021-11-24T18:50:36.000Z | loica/colony.py | SynBioUC/LOICA | b5eee507b42572cde85230c32933e1196ca4002e | [
"MIT"
] | 1 | 2020-11-16T22:40:34.000Z | 2020-11-16T22:40:34.000Z | import numpy as np
class Colony:
def __init__(self,
circuit=None,
r0=1,
mu0=1
):
self.circuit = circuit
self.r0 = r0
self.mu0 = mu0
def fun(self, x):
# Compute growth rates on mesh
mu = np.exp(-x)
vel = 0.5 * (1 ... | 31.022989 | 102 | 0.48166 |
34916f0141968f0494457431c1af88092212ed46 | 11,548 | py | Python | 51job/jobExcel.py | xmcy0011/crawler3 | e04d3e5faf09ed1d0c9daf97401f0eef8d20124a | [
"BSD-3-Clause"
] | 6 | 2020-10-20T07:19:00.000Z | 2022-03-01T03:43:47.000Z | 51job/jobExcel.py | xmcy0011/crawler3 | e04d3e5faf09ed1d0c9daf97401f0eef8d20124a | [
"BSD-3-Clause"
] | null | null | null | 51job/jobExcel.py | xmcy0011/crawler3 | e04d3e5faf09ed1d0c9daf97401f0eef8d20124a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
import socket
import urllib.request
import ssl
import re
import xlwt # 用来创建excel文档并写入数据
import json
import threading # 多线程抓取
import time
from urllib.parse import quote
def url_config(jobName):
# 北上广深杭 不限行业
url = "https://search.51job.com/list/020000%252C010000%252C030200%252C040000%25... | 34.267062 | 225 | 0.551005 |
0b90dfb41938b0ecfe276f0f810565e8838ee244 | 5,682 | py | Python | travertino/constants.py | SamSchott/travertino | 5fa1ee72facc977425bdd65a87852e4079f8d418 | [
"BSD-3-Clause"
] | null | null | null | travertino/constants.py | SamSchott/travertino | 5fa1ee72facc977425bdd65a87852e4079f8d418 | [
"BSD-3-Clause"
] | null | null | null | travertino/constants.py | SamSchott/travertino | 5fa1ee72facc977425bdd65a87852e4079f8d418 | [
"BSD-3-Clause"
] | null | null | null | ######################################################################
# Common constants
######################################################################
NORMAL = 'normal'
LEFT = 'left'
RIGHT = 'right'
TOP = 'top'
BOTTOM = 'bottom'
CENTER = 'center'
#############################################################... | 24.491379 | 70 | 0.551742 |
698955bcff75c83c328e49aaf8bb3e4f24c5c17d | 656 | py | Python | ch11/test_cities.py | montalvas/Python-Crash-Course | fd657f979017985230748674c9048287f7609145 | [
"MIT"
] | null | null | null | ch11/test_cities.py | montalvas/Python-Crash-Course | fd657f979017985230748674c9048287f7609145 | [
"MIT"
] | null | null | null | ch11/test_cities.py | montalvas/Python-Crash-Course | fd657f979017985230748674c9048287f7609145 | [
"MIT"
] | null | null | null | import unittest
from unittest.case import TestCase
from city_functions import get_formatted_location
class CityTestCase(TestCase):
"""Testes para 'city_functions.py'"""
def test_city_country_name(self):
"""Nomes como 'Santiago, Chile'"""
location = get_formatted_location('Santiago', 'Chil... | 32.8 | 73 | 0.70122 |
ff7459c35f2acdd9c2bd1438cc4c53f2c1539dbf | 255 | py | Python | sciapp/action/__init__.py | cycleuser/imagepy | 5dc1a9a8137280c5215287392ba1b23d368bd7e9 | [
"BSD-4-Clause"
] | 1 | 2020-06-17T05:16:46.000Z | 2020-06-17T05:16:46.000Z | sciapp/action/__init__.py | cycleuser/imagepy | 5dc1a9a8137280c5215287392ba1b23d368bd7e9 | [
"BSD-4-Clause"
] | null | null | null | sciapp/action/__init__.py | cycleuser/imagepy | 5dc1a9a8137280c5215287392ba1b23d368bd7e9 | [
"BSD-4-Clause"
] | null | null | null | from .action import SciAction
from .imgact import ImgAction
from .tolact import Tool, DefaultTool, ImageTool, ShapeTool, TableTool
from .meaact import DistanceTool, AngleTool, SlopeTool, AreaTool, CoordinateTool
from .shpact import *
from .roiact import * | 42.5 | 80 | 0.815686 |
d5c6ec117231c87c169f8957f456b1661aa966e3 | 390 | py | Python | Desafios/Desafio 63.py | blopah/python3-curso-em-video-gustavo-guanabara-exercicios | d86c613ea8bb335c4dd888a34bda456055e4d82e | [
"MIT"
] | 2 | 2021-02-06T04:35:44.000Z | 2021-02-08T02:37:33.000Z | Desafios/Desafio 63.py | blopah/python3-curso-em-video-gustavo-guanabara-exercicios | d86c613ea8bb335c4dd888a34bda456055e4d82e | [
"MIT"
] | null | null | null | Desafios/Desafio 63.py | blopah/python3-curso-em-video-gustavo-guanabara-exercicios | d86c613ea8bb335c4dd888a34bda456055e4d82e | [
"MIT"
] | null | null | null | print("""Escreva um programa que leia um número n inteiro
qualquer e mostre na tela os n primeiros elementos de uma
sequencia de Fibonacci.""")
n = int(input('Insira um número inteiro: '))
fibl = [0, 1]
for f in range(0, n, 1):
soma = fibl[-2] + fibl[-1]
fibl.append(soma)
# fibonacci = str(fibl)
print('Os {}... | 32.5 | 81 | 0.661538 |
1ee0ad243db8f69752aed5641c8bb5ef8fda28e6 | 1,829 | py | Python | places/tests/models/test_restaurant.py | huangsam/chowist | 6857e005dfec1ab71bea81cce7b91efd1a74450f | [
"MIT"
] | 11 | 2018-11-08T17:35:09.000Z | 2021-11-11T15:07:45.000Z | places/tests/models/test_restaurant.py | huangsam/ciscochef | ee2337c64edd76bfb80afc765e4169df0808c8c6 | [
"MIT"
] | 12 | 2018-06-16T18:40:53.000Z | 2021-06-10T17:43:31.000Z | places/tests/models/test_restaurant.py | huangsam/ciscochef | ee2337c64edd76bfb80afc765e4169df0808c8c6 | [
"MIT"
] | 7 | 2018-07-26T06:41:37.000Z | 2021-02-16T16:36:29.000Z | from django.test import TestCase
from places.models import Restaurant
_FIVE_GUYS = "Five Guys"
_IN_N_OUT = "In N Out"
class TestRestaurant(TestCase):
"""Restaurant test suite"""
def setUp(self):
Restaurant.objects.create(
name=_FIVE_GUYS,
address="Earth",
latitu... | 30.483333 | 88 | 0.644615 |
c36deb26885d2c80df98328a9853e2e2ea5c5a05 | 5,740 | py | Python | lib/galaxy/datatypes/graph.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | 47 | 2015-10-21T23:30:30.000Z | 2022-03-09T06:51:32.000Z | lib/galaxy/datatypes/graph.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | 209 | 2015-06-17T16:15:20.000Z | 2022-03-21T15:23:07.000Z | lib/galaxy/datatypes/graph.py | rhpvorderman/galaxy | 178015f8eff0b0c7a59c0d6756658f6428222837 | [
"CC-BY-3.0"
] | 35 | 2015-10-30T13:09:40.000Z | 2021-05-03T23:17:46.000Z | """
Graph content classes.
"""
import logging
from galaxy.util import simplegraph
from . import (
data,
dataproviders,
tabular,
xml
)
log = logging.getLogger(__name__)
@dataproviders.decorators.has_dataproviders
class Xgmml(xml.GenericXml):
"""
XGMML graph format
(http://wiki.cytoscape.o... | 35 | 115 | 0.602265 |
ea294785ad9956f2992d7dc4e19ea4023ad65482 | 3,363 | py | Python | publist.py | mbeland/gold-publist | 133fd23dc8f4410990f9112711e9636113fc7098 | [
"MIT"
] | null | null | null | publist.py | mbeland/gold-publist | 133fd23dc8f4410990f9112711e9636113fc7098 | [
"MIT"
] | null | null | null | publist.py | mbeland/gold-publist | 133fd23dc8f4410990f9112711e9636113fc7098 | [
"MIT"
] | null | null | null | """!pub <command> <arguments> is a publication tracking system
Commands:
* `new`: Someone published an article to be tracked
* `report`: List of publications by user or time
"""
import argparse
import datetime
import dateparser
import re
import urlmarker
def create_database(server):
"""Define the database use... | 26.904 | 80 | 0.593518 |
0a45d385936c7c7a02470bd6a46d78dc7175c24b | 3,033 | py | Python | OLD/config/old/vgg_depth.py | ivankreso/semseg | fcd2889a1e9e03c3d1a71d19d68d15ce25a5dc79 | [
"MIT"
] | 2 | 2017-11-17T06:55:44.000Z | 2019-06-11T13:07:05.000Z | OLD/config/old/vgg_depth.py | ivankreso/semseg | fcd2889a1e9e03c3d1a71d19d68d15ce25a5dc79 | [
"MIT"
] | null | null | null | OLD/config/old/vgg_depth.py | ivankreso/semseg | fcd2889a1e9e03c3d1a71d19d68d15ce25a5dc79 | [
"MIT"
] | null | null | null | import os
import tensorflow as tf
import train_helper
#MODEL_PATH = './models/vgg.py'
#MODEL_PATH = './models/all_dilated.py'
MODEL_PATH = './models/vgg_depth.py'
#MODEL_PATH = './models/six_blocks.py'
#MODEL_PATH = './models/dilated_multiscale.py'
#MODEL_PATH = './models/baseline.py'
#MODEL_PATH = './models/dilated_... | 40.986486 | 100 | 0.712496 |
90c24c2169099199ee1069dacaf1f44c2f1d8288 | 1,170 | py | Python | taxi/commands/stop.py | gnutix/taxi | 3abad480bbc07a0ac1c47c16ee0989227234505b | [
"WTFPL"
] | null | null | null | taxi/commands/stop.py | gnutix/taxi | 3abad480bbc07a0ac1c47c16ee0989227234505b | [
"WTFPL"
] | null | null | null | taxi/commands/stop.py | gnutix/taxi | 3abad480bbc07a0ac1c47c16ee0989227234505b | [
"WTFPL"
] | null | null | null | import datetime
import click
from ..exceptions import NoActivityInProgressError, ParseError, StopInThePastError
from .base import cli, get_timesheet_collection_for_context
@cli.command(short_help="Record time spent on an activity.")
@click.argument('description', nargs=-1)
@click.option('-f', '--file', 'f', type=cl... | 32.5 | 82 | 0.671795 |
d59182a28667404aaafc276abeac1c833ca1d872 | 4,127 | py | Python | prototypes/v1/filename_in_folder.py | blairg23/files-in-folder | fc4a8010fca7c11cacb07b304d8d5c37b98feebd | [
"MIT"
] | null | null | null | prototypes/v1/filename_in_folder.py | blairg23/files-in-folder | fc4a8010fca7c11cacb07b304d8d5c37b98feebd | [
"MIT"
] | null | null | null | prototypes/v1/filename_in_folder.py | blairg23/files-in-folder | fc4a8010fca7c11cacb07b304d8d5c37b98feebd | [
"MIT"
] | null | null | null | '''
Name: filename_in_folder.py
Date: 2015-10-06
Author: Blair Gemmer
Description: Check if the file from the left folder is in the right folder.
The left folder contains files with the format "IMG_YYYYMMDD_HHMMSS.jpg", where HH is in 24 hour format, as well
as files with the format "Screenshot_YYYY-MM-DD-HH-MM-SS.png... | 36.201754 | 139 | 0.71117 |
6568613559363855eb31bbff3df9d21a884df882 | 1,527 | py | Python | Parse_audit.py | baharababah/Database-auditing-of-cockroachdb | fb3e969544f67e85cecbc18ca7cd0baf6cfa4022 | [
"MIT"
] | null | null | null | Parse_audit.py | baharababah/Database-auditing-of-cockroachdb | fb3e969544f67e85cecbc18ca7cd0baf6cfa4022 | [
"MIT"
] | null | null | null | Parse_audit.py | baharababah/Database-auditing-of-cockroachdb | fb3e969544f67e85cecbc18ca7cd0baf6cfa4022 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import re
import time
import datetime
def process_audit_data(file_name):
start_time = time.time()
PATTERN_ROW = r'((?im)(?P<data>^I\d+)\s+(?P<time>\d{2}:\d{2}:\d{2}.\d+)\s+\d+\s+sql/exec_log.go:\d+\s+\[n1,client=(?P<client>\d{1,3}.\d{1,3}.\d{1,3}.\... | 27.763636 | 309 | 0.555992 |
684e8e05bc24a39ba0ffc07ecb7341c4cfff4408 | 593 | py | Python | sols/1455.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | sols/1455.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | sols/1455.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | class Solution:
# Split + Slice (Accepted), O(n) time and space
def isPrefixOfWord(self, sentence: str, searchWord: str) -> int:
words, n = sentence.split(), len(searchWord)
for i in range(len(words)):
if words[i][:n] == searchWord:
return i+1
return -1
#... | 37.0625 | 69 | 0.571669 |
42f683c1c2c8f15ad955d053d320bd71632b2c0b | 3,448 | py | Python | lib/getui/igetui/template/style/Style6.py | fanylee/github | 8f6a1b240fda800fa0b53ba6236c5f2df0fe84b0 | [
"Apache-2.0"
] | null | null | null | lib/getui/igetui/template/style/Style6.py | fanylee/github | 8f6a1b240fda800fa0b53ba6236c5f2df0fe84b0 | [
"Apache-2.0"
] | null | null | null | lib/getui/igetui/template/style/Style6.py | fanylee/github | 8f6a1b240fda800fa0b53ba6236c5f2df0fe84b0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from .AbstractNotifyStyle import *
from protobuf.gt_req_pb2 import InnerFiled
class Style6(AbstractNotifyStyle):
def __init__(self):
AbstractNotifyStyle.__init__(self)
self.text = ""
self.title = ""
self.logo = ""
self.logoUrl = ""
self.bigSty... | 37.478261 | 78 | 0.616299 |
eddad730d58efe26965e7b86db88e2931d841c18 | 508 | py | Python | rastervision_aws_batch/rastervision/aws_batch/__init__.py | theoway/raster-vision | dab675517f904771e2ce8c052494f8a6f1ddc026 | [
"Apache-2.0"
] | 1,577 | 2017-05-22T14:22:00.000Z | 2022-03-31T02:03:25.000Z | rastervision_aws_batch/rastervision/aws_batch/__init__.py | theoway/raster-vision | dab675517f904771e2ce8c052494f8a6f1ddc026 | [
"Apache-2.0"
] | 933 | 2017-05-09T20:25:02.000Z | 2022-03-31T10:22:59.000Z | rastervision_aws_batch/rastervision/aws_batch/__init__.py | monocilindro/raster-vision | fc181a6f31f085affa1ee12f0204bdbc5a6bf85a | [
"Apache-2.0"
] | 336 | 2017-05-15T16:30:44.000Z | 2022-03-28T06:19:33.000Z | # flake8: noqa
import rastervision.pipeline
from rastervision.aws_batch.aws_batch_runner import *
def register_plugin(registry):
registry.set_plugin_version('rastervision.aws_batch', 0)
registry.set_plugin_aliases('rastervision.aws_batch',
['rastervision2.aws_batch'])
regi... | 31.75 | 71 | 0.708661 |
c3e5aafabfe06504b8a05200126d06ec3c12e778 | 211,558 | py | Python | xarray/tests/test_dataarray.py | raphaeldussin/xarray | 3820fb77256682d909c1e41d962e29bec0edd62d | [
"Apache-2.0"
] | 3 | 2018-07-25T17:43:15.000Z | 2020-03-26T12:44:20.000Z | xarray/tests/test_dataarray.py | raphaeldussin/xarray | 3820fb77256682d909c1e41d962e29bec0edd62d | [
"Apache-2.0"
] | 1 | 2020-06-30T02:32:55.000Z | 2020-06-30T02:32:55.000Z | xarray/tests/test_dataarray.py | Mikejmnez/xarray | 62893abeb9ae29221ab9a635bd18de903a930e33 | [
"Apache-2.0"
] | 1 | 2015-03-30T13:53:08.000Z | 2015-03-30T13:53:08.000Z | import pickle
import sys
import warnings
from copy import deepcopy
from textwrap import dedent
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from xarray import DataArray, Dataset, IndexVariable, Variable, align, broadcast
from xarray.coding.times import CFDatetimeCoder
from xarray.convert i... | 36.356419 | 95 | 0.538406 |
fe00e6eddfe93484959193feda60e8ef98baf2d7 | 14,600 | py | Python | S_EqT_codes/src/EqT_libs/downloader.py | MrXiaoXiao/SiameseEarthquakeTransformer | 6774de57b2b6dcf38d23bf43d30ec165147102b9 | [
"MIT"
] | 12 | 2021-05-07T08:17:12.000Z | 2022-03-01T04:25:31.000Z | src/S_EqT_codes/src/EqT_libs/downloader.py | Damin1909/ESPRH | 2b26a7e698fe7c411d44ce5f51d52fffdb742d48 | [
"MIT"
] | 5 | 2021-12-04T17:00:03.000Z | 2022-03-17T04:02:11.000Z | src/S_EqT_codes/src/EqT_libs/downloader.py | Damin1909/ESPRH | 2b26a7e698fe7c411d44ce5f51d52fffdb742d48 | [
"MIT"
] | 4 | 2021-07-15T11:37:20.000Z | 2022-01-07T10:49:50.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 31 21:21:31 2019
@author: mostafamousavi
last update: 04-03-2020
"""
import json
import time
from obspy.clients.fdsn.mass_downloader import RectangularDomain, Restrictions, MassDownloader
from obspy import UTCDateTime
import datetime
import os
fro... | 37.435897 | 295 | 0.503356 |
2a16be1ad2539c7c69c3f18d7271e9f2e8e51709 | 41,178 | py | Python | openmc/mesh.py | ilhamv/openmc | 46b42d5eadef701c024e04a94be510ffb1d7aa2d | [
"MIT"
] | 1 | 2019-08-27T19:49:57.000Z | 2019-08-27T19:49:57.000Z | openmc/mesh.py | ilhamv/openmc | 46b42d5eadef701c024e04a94be510ffb1d7aa2d | [
"MIT"
] | null | null | null | openmc/mesh.py | ilhamv/openmc | 46b42d5eadef701c024e04a94be510ffb1d7aa2d | [
"MIT"
] | null | null | null | from abc import ABC
from collections.abc import Iterable
from numbers import Real, Integral
import warnings
from xml.etree import ElementTree as ET
import numpy as np
import openmc.checkvalue as cv
import openmc
from ._xml import get_text
from .mixin import IDManagerMixin
from .surface import _BOUNDARY_TYPES
class ... | 31.822257 | 97 | 0.573024 |
d14e6a4a7790b1dbe093ae9c3dafab53c6ee02f8 | 742 | py | Python | setup.py | 2bright/adapow2 | 5f06c18ba95a61dc910ab5ad28b490c44841ae3b | [
"Apache-2.0"
] | null | null | null | setup.py | 2bright/adapow2 | 5f06c18ba95a61dc910ab5ad28b490c44841ae3b | [
"Apache-2.0"
] | null | null | null | setup.py | 2bright/adapow2 | 5f06c18ba95a61dc910ab5ad28b490c44841ae3b | [
"Apache-2.0"
] | 1 | 2019-05-13T03:12:54.000Z | 2019-05-13T03:12:54.000Z | import setuptools
with open("README.md", "r", encoding='utf-8') as fh:
long_description = fh.read()
setuptools.setup(
name="adapow2",
version="1.0.0",
author="Liang WenJie",
author_email="l.wen.jie@qq.com",
description="Adapow2 is a serial of adaptive gradient descent optimizers by adjusting t... | 32.26087 | 127 | 0.675202 |
e9d9802c4a55452a24f3b3511c5511db6151741a | 6,760 | py | Python | src/anasin/anasin.py | OutatimeSoftware/Analex | 99601d69f6c97407db0765ba56fd38241554a3c8 | [
"MIT"
] | null | null | null | src/anasin/anasin.py | OutatimeSoftware/Analex | 99601d69f6c97407db0765ba56fd38241554a3c8 | [
"MIT"
] | null | null | null | src/anasin/anasin.py | OutatimeSoftware/Analex | 99601d69f6c97407db0765ba56fd38241554a3c8 | [
"MIT"
] | null | null | null | import sys
sys.path.append('src/')
from syntax import syn
file = open('{}.lex'.format(sys.argv[1]))
initialStack = []
actualStack=['#']
def isEmpty():
return actualStack==['#']
def push(item):
actualStack.append(item)
def pop():
return actualStack.pop()
def inspect():
return actualStack[len(actualStack)-1]
... | 26.509804 | 166 | 0.561982 |
45f7c16e7a0cd91627b8dcf4d0d47c1f001d8149 | 227 | py | Python | HackerRank/Python/Easy/E0072.py | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 54 | 2019-05-13T12:13:09.000Z | 2022-02-27T02:59:00.000Z | HackerRank/Python/Easy/E0072.py | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 2 | 2020-10-02T07:16:43.000Z | 2020-10-19T04:36:19.000Z | HackerRank/Python/Easy/E0072.py | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 20 | 2020-05-26T09:48:13.000Z | 2022-03-18T15:18:27.000Z | # Problem Statement: https://www.hackerrank.com/challenges/np-zeros-and-ones/problem
import numpy as np
shape = np.array(input().split(), dtype='int32')
print(np.zeros(shape, dtype='int8'))
print(np.ones(shape, dtype='int8')) | 32.428571 | 84 | 0.731278 |
62f8ad56ebcaf52509d8531edd7928144fde233a | 16,122 | py | Python | pyiso/base.py | bolliger32/pyiso | 5cc5c5018f6fcbcde4779033b4d6fdfc678b04a4 | [
"Apache-2.0"
] | null | null | null | pyiso/base.py | bolliger32/pyiso | 5cc5c5018f6fcbcde4779033b4d6fdfc678b04a4 | [
"Apache-2.0"
] | null | null | null | pyiso/base.py | bolliger32/pyiso | 5cc5c5018f6fcbcde4779033b4d6fdfc678b04a4 | [
"Apache-2.0"
] | null | null | null | import logging
from collections import namedtuple
from dateutil.parser import parse as dateutil_parse
from datetime import datetime, timedelta
import pytz
import urllib2
import requests
import pandas as pd
import zipfile
from StringIO import StringIO
import time
# named tuple for time period interval labels
IntervalC... | 39.514706 | 150 | 0.608919 |
5e518adde04acf487f851da2f4bb37b352df62a0 | 29,648 | py | Python | airflow/providers/amazon/aws/hooks/base_aws.py | holly-evans/airflow | 865406cbab4defd35c95afbf0a8d5987ff7788b1 | [
"Apache-2.0"
] | null | null | null | airflow/providers/amazon/aws/hooks/base_aws.py | holly-evans/airflow | 865406cbab4defd35c95afbf0a8d5987ff7788b1 | [
"Apache-2.0"
] | null | null | null | airflow/providers/amazon/aws/hooks/base_aws.py | holly-evans/airflow | 865406cbab4defd35c95afbf0a8d5987ff7788b1 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 42.905933 | 117 | 0.668679 |
039c9d015b94489124924ddec6530cd4cb772d8f | 3,059 | py | Python | python/ray/tune/suggest/skopt.py | FieldMrFive/ray | a22d6ef95594a3b95fac5b2eb17f7f21be2888e8 | [
"Apache-2.0"
] | 3 | 2019-05-01T04:31:20.000Z | 2021-03-01T09:25:36.000Z | python/ray/tune/suggest/skopt.py | collinswei/ray | 2e30f7ba386e716bf80f019dcd473b67d83abb95 | [
"Apache-2.0"
] | 2 | 2019-01-28T00:31:25.000Z | 2019-11-26T16:57:06.000Z | python/ray/tune/suggest/skopt.py | collinswei/ray | 2e30f7ba386e716bf80f019dcd473b67d83abb95 | [
"Apache-2.0"
] | 2 | 2020-03-26T16:32:08.000Z | 2021-02-05T17:04:11.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
try:
import skopt
except Exception:
skopt = None
from ray.tune.suggest.suggestion import SuggestionAlgorithm
class SkOptSearch(SuggestionAlgorithm):
"""A wrapper around skopt to provide trial sug... | 34.370787 | 78 | 0.5966 |
6cf3224823627061e93a06e8eb9ea0e527721bd6 | 122 | py | Python | plotly/validators/table/domain/__init__.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/table/domain/__init__.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/table/domain/__init__.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | from ._y import YValidator
from ._x import XValidator
from ._row import RowValidator
from ._column import ColumnValidator
| 24.4 | 36 | 0.836066 |
a2ac54c49be0b443c5ff174a3a94042b9be6dd5b | 15,894 | py | Python | docs/conf.py | mathias-gr/python-pptx | 8e41476961cc1f2d7d7f0d1d7e4bb2a083d84a40 | [
"MIT"
] | null | null | null | docs/conf.py | mathias-gr/python-pptx | 8e41476961cc1f2d7d7f0d1d7e4bb2a083d84a40 | [
"MIT"
] | null | null | null | docs/conf.py | mathias-gr/python-pptx | 8e41476961cc1f2d7d7f0d1d7e4bb2a083d84a40 | [
"MIT"
] | 3 | 2019-05-28T16:28:53.000Z | 2020-07-28T19:13:44.000Z | # -*- coding: utf-8 -*-
#
# python-pptx documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 29 13:59:35 2012.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | 28.130973 | 79 | 0.695483 |
06c6928d058ad79f48061fde684f0b3f76fd6aff | 14,027 | py | Python | BigInteger.py | Qjbtiger/TplinkRouterChecker | 92bce66db8ac7990270bcf24676abe1b4cc6a082 | [
"MIT"
] | null | null | null | BigInteger.py | Qjbtiger/TplinkRouterChecker | 92bce66db8ac7990270bcf24676abe1b4cc6a082 | [
"MIT"
] | null | null | null | BigInteger.py | Qjbtiger/TplinkRouterChecker | 92bce66db8ac7990270bcf24676abe1b4cc6a082 | [
"MIT"
] | null | null | null | import math
charset = "0123456789abcdefghijklmnopqrstuvwxyz"
BI_FP = 52
def char2int(char):
if (char >= 'A' and char <='Z'):
return ord(char) - ord('A') + 10
elif (char >= 'a' and char <='z'):
return ord(char) - ord('a') + 10
elif (char >= '0' and char <='9'):
return ord(char) - or... | 25.273874 | 106 | 0.365153 |
bbaf36b180a86d0fb03a0bd9f6fe5680a42c08d1 | 5,896 | py | Python | src/python/pants/backend/awslambda/python/rules_test.py | chebbyChefNEQ/pants | a53b9d29a160f36f9af1d1a2c43a693b6a55fa55 | [
"Apache-2.0"
] | 1 | 2016-04-27T15:35:42.000Z | 2016-04-27T15:35:42.000Z | src/python/pants/backend/awslambda/python/rules_test.py | patricklaw/pants | 906099f5c0d2f9e6adcac23e030270c64ca519ae | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/awslambda/python/rules_test.py | patricklaw/pants | 906099f5c0d2f9e6adcac23e030270c64ca519ae | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from io import BytesIO
from textwrap import dedent
from zipfile import ZipFile
import pytest
from pants.backend.awslambda.python.rules import PythonAw... | 36.171779 | 98 | 0.619742 |
7d66da466530418d086bcdd4a482cbc1e9cfcec7 | 26,819 | py | Python | scripts/deploy_v2_1.py | Sagar133/alpha-homora-v2-public-contract | 1e8bb6eda6da27b24a15b99eca049bb6f8406d08 | [
"MIT"
] | 58 | 2020-12-03T04:08:52.000Z | 2021-07-16T18:56:48.000Z | scripts/deploy_v2_1.py | Sagar133/alpha-homora-v2-public-contract | 1e8bb6eda6da27b24a15b99eca049bb6f8406d08 | [
"MIT"
] | 7 | 2021-01-23T22:04:58.000Z | 2021-02-25T08:41:41.000Z | scripts/deploy_v2_1.py | Sagar133/alpha-homora-v2-public-contract | 1e8bb6eda6da27b24a15b99eca049bb6f8406d08 | [
"MIT"
] | 28 | 2020-12-18T10:50:26.000Z | 2021-07-02T18:11:15.000Z | from brownie import (
accounts, ERC20KP3ROracle, UniswapV2Oracle, BalancerPairOracle, ProxyOracle, CoreOracle,
HomoraBank, CurveOracle, UniswapV2SpellV1, WERC20, WLiquidityGauge, WMasterChef,
WStakingRewards, SushiswapSpellV1, BalancerSpellV1, CurveSpellV1,
)
from brownie import interface
from .utils import... | 32.195678 | 152 | 0.63537 |
48fdad57bcb14d5a8824bde9277cf0a8881923a9 | 4,799 | py | Python | splunk/search/bin/return.py | torstefan/derp | 9fb26f339560fc44d8a499dc7f0ef0a56d8389ce | [
"Beerware"
] | null | null | null | splunk/search/bin/return.py | torstefan/derp | 9fb26f339560fc44d8a499dc7f0ef0a56d8389ce | [
"Beerware"
] | null | null | null | splunk/search/bin/return.py | torstefan/derp | 9fb26f339560fc44d8a499dc7f0ef0a56d8389ce | [
"Beerware"
] | null | null | null | # Version 4.0
#
# GOAL: to make subsearches easier, shorter, more obvious.
# current examples from answers.splunk.com
# [... | head 2 | eval time=_time | fields time]
# [... | head 2 | table source ]
# [... |fields id]
# [... | head 1 | rename _time as eventtype]
# [ ... | fields a | rename a as s... | 33.326389 | 126 | 0.540738 |
461e9ae861f05663892a0b22cebcb787f88f462b | 348 | py | Python | students/K33401/practical_works/Dorofeeva_Arina/simple_django_web_project/blogfspo/blog/migrations/0003_rename_number_car_brand.py | kuriyummy/ITMO_ICT_WebDevelopment_2021-2022 | 3e17b1a950c9af6607ae1afc02a0a5412649185c | [
"MIT"
] | null | null | null | students/K33401/practical_works/Dorofeeva_Arina/simple_django_web_project/blogfspo/blog/migrations/0003_rename_number_car_brand.py | kuriyummy/ITMO_ICT_WebDevelopment_2021-2022 | 3e17b1a950c9af6607ae1afc02a0a5412649185c | [
"MIT"
] | null | null | null | students/K33401/practical_works/Dorofeeva_Arina/simple_django_web_project/blogfspo/blog/migrations/0003_rename_number_car_brand.py | kuriyummy/ITMO_ICT_WebDevelopment_2021-2022 | 3e17b1a950c9af6607ae1afc02a0a5412649185c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-11-09 19:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_car_number'),
]
operations = [
migrations.RenameField(
model_name='car',
old_name='number',
new_nam... | 18.315789 | 47 | 0.566092 |
988419a97f9ef0f0d4653aa1ddcb25c6f781b106 | 5,385 | py | Python | hub/views.py | NexClipper/exporterhub-be | 5c8eea9a9d38d3f16cfdf498db2278c1564e3449 | [
"Apache-2.0"
] | 3 | 2020-11-23T09:18:50.000Z | 2021-01-07T08:52:04.000Z | hub/views.py | NexClipper/exporterhub-be | 5c8eea9a9d38d3f16cfdf498db2278c1564e3449 | [
"Apache-2.0"
] | null | null | null | hub/views.py | NexClipper/exporterhub-be | 5c8eea9a9d38d3f16cfdf498db2278c1564e3449 | [
"Apache-2.0"
] | 1 | 2020-11-24T10:14:06.000Z | 2020-11-24T10:14:06.000Z | import json
import requests
import base64
from django.views import View
from django.http import JsonResponse
from .models import Exporter, Release, Category
from my_settings import TOKEN
api_url='https://api.github.com/repos/'
headers={'Authorization':TOKEN}
class RepositoryView(View):
def get_repo(self, repo_... | 38.741007 | 85 | 0.474838 |
6da635524b9fdf7943ff417e908ac5913f427058 | 6,781 | py | Python | src/pretalx/common/views.py | codingcatgirl/pretalx | 26554967772efa5248ae9b6a0fa838b0e8713807 | [
"Apache-2.0"
] | null | null | null | src/pretalx/common/views.py | codingcatgirl/pretalx | 26554967772efa5248ae9b6a0fa838b0e8713807 | [
"Apache-2.0"
] | null | null | null | src/pretalx/common/views.py | codingcatgirl/pretalx | 26554967772efa5248ae9b6a0fa838b0e8713807 | [
"Apache-2.0"
] | null | null | null | import urllib
from contextlib import suppress
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import login
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.http import FileResponse, Http404, HttpResponseServerError
from django.shortcuts ... | 35.317708 | 114 | 0.676891 |
6e4987f0c187c332b6914a5f7285a47e1406a1b0 | 11,515 | py | Python | payeezy_python/example/Dependancy/requests-master/requests/packages/urllib3/response.py | Dylfin/payeezy_direct_API | d0ec010dd265421ddc002e665221312178e2b0fe | [
"MIT"
] | 76 | 2015-04-28T18:50:16.000Z | 2022-03-21T18:52:44.000Z | payeezy_python/example/Dependancy/requests-master/requests/packages/urllib3/response.py | Dylfin/payeezy_direct_API | d0ec010dd265421ddc002e665221312178e2b0fe | [
"MIT"
] | 17 | 2015-07-15T17:46:41.000Z | 2022-03-01T19:14:48.000Z | payeezy_python/example/Dependancy/requests-master/requests/packages/urllib3/response.py | Dylfin/payeezy_direct_API | d0ec010dd265421ddc002e665221312178e2b0fe | [
"MIT"
] | 149 | 2015-04-13T04:51:09.000Z | 2021-07-06T14:16:20.000Z | import zlib
import io
from socket import timeout as SocketTimeout
from ._collections import HTTPHeaderDict
from .exceptions import ProtocolError, DecodeError, ReadTimeoutError
from .packages.six import string_types as basestring, binary_type
from .connection import HTTPException, BaseSSLError
from .util.respon... | 35.872274 | 94 | 0.572123 |
b639e2820107c35fe97572280594c3ced81518f7 | 5,883 | py | Python | src/data/utils/places_utils.py | enric1994/dr4oc | bf61929ab14fcdbbb784df05d97154a89a6eca10 | [
"MIT"
] | 1 | 2022-02-26T12:45:30.000Z | 2022-02-26T12:45:30.000Z | src/data/utils/places_utils.py | enric1994/dr4oc | bf61929ab14fcdbbb784df05d97154a89a6eca10 | [
"MIT"
] | null | null | null | src/data/utils/places_utils.py | enric1994/dr4oc | bf61929ab14fcdbbb784df05d97154a89a6eca10 | [
"MIT"
] | 1 | 2022-02-26T12:45:32.000Z | 2022-02-26T12:45:32.000Z | import os
import random
train_categories = ['cliff', 'hotel-outdoor', 'hangar-outdoor', 'bridge', 'moat-water', 'pond', 'hospital_room', 'mezzanine', 'ocean', 'apartment_building-outdoor', 'shoe_shop', 'bow_window-indoor', 'raceway', 'arena-performance', 'forest_path', 'ski_slope', 'building_facade', 'boathouse', 'har... | 346.058824 | 5,517 | 0.722421 |
4c85a2197c206c9a6b3616d1177f16335a652ae6 | 11,348 | py | Python | aggregateur/validators.py | Fonaine/schema.data.gouv.fr | edf35f6cd23541ae8671c331865d884f6f164b30 | [
"MIT"
] | null | null | null | aggregateur/validators.py | Fonaine/schema.data.gouv.fr | edf35f6cd23541ae8671c331865d884f6f164b30 | [
"MIT"
] | null | null | null | aggregateur/validators.py | Fonaine/schema.data.gouv.fr | edf35f6cd23541ae8671c331865d884f6f164b30 | [
"MIT"
] | null | null | null | import os
import shutil
import json
import exceptions
import yaml
import tableschema
import jsonschema
import frontmatter
from lxml import etree
from table_schema_to_markdown import convert_source
class BaseValidator(object):
CHANGELOG_FILENAME = "CHANGELOG.md"
def __init__(self, repo):
super(BaseV... | 33.474926 | 85 | 0.577282 |
9162fb8d9b18c1838f7cf541b66d9d39dd786cc8 | 437 | py | Python | tests/test_serializers.py | Zagrebelin/drf-tracking | 5fe102439e7baaffc886253e39c21dd96481391f | [
"ISC"
] | 387 | 2015-05-26T08:23:52.000Z | 2022-03-18T11:10:44.000Z | tests/test_serializers.py | Zagrebelin/drf-tracking | 5fe102439e7baaffc886253e39c21dd96481391f | [
"ISC"
] | 138 | 2015-05-26T16:20:25.000Z | 2021-09-22T18:07:24.000Z | tests/test_serializers.py | Zagrebelin/drf-tracking | 5fe102439e7baaffc886253e39c21dd96481391f | [
"ISC"
] | 121 | 2015-09-25T16:53:48.000Z | 2021-08-18T12:42:04.000Z | from django.contrib.auth.models import User
from rest_framework import serializers
from rest_framework_tracking.models import APIRequestLog
class ApiRequestLogSerializer(serializers.ModelSerializer):
class Meta:
model = APIRequestLog
fields = ('view',)
class UserSerializer(serializers.ModelSeria... | 27.3125 | 71 | 0.727689 |
da833f4bed8d011a3d10c7c93dabd4b39a69bbd5 | 14,240 | py | Python | libs/algo/odc/algo/_geomedian.py | zidingz/odc-tools | 2c624b054d03f7d3d1ef378fdd007ed90b46a59a | [
"Apache-2.0"
] | 29 | 2019-09-18T10:21:07.000Z | 2022-03-10T07:46:57.000Z | libs/algo/odc/algo/_geomedian.py | zidingz/odc-tools | 2c624b054d03f7d3d1ef378fdd007ed90b46a59a | [
"Apache-2.0"
] | 259 | 2019-12-11T03:19:01.000Z | 2022-03-31T22:46:11.000Z | libs/algo/odc/algo/_geomedian.py | zidingz/odc-tools | 2c624b054d03f7d3d1ef378fdd007ed90b46a59a | [
"Apache-2.0"
] | 18 | 2020-01-22T14:50:27.000Z | 2022-03-01T14:48:12.000Z | """ Helper methods for Geometric Median computation.
"""
from typing import Optional, Tuple, Union
import numpy as np
import xarray as xr
import dask
import dask.array as da
import functools
from ._dask import randomize, reshape_yxbt
from ._masking import to_float_np, from_float_np
from ._memsink import yxbt_sink
def... | 31.644444 | 103 | 0.593469 |
5825c14821c76e90269bc986588ee40a40b21363 | 62 | py | Python | Server/database/__init__.py | Ricky-Hao/IMPK-Server | 786e24269e7cc506a82ae8aa0fa0d1df8c478f51 | [
"MIT"
] | null | null | null | Server/database/__init__.py | Ricky-Hao/IMPK-Server | 786e24269e7cc506a82ae8aa0fa0d1df8c478f51 | [
"MIT"
] | 1 | 2018-06-01T07:45:03.000Z | 2018-06-01T07:45:03.000Z | Server/database/__init__.py | Ricky-Hao/IMPK-Server | 786e24269e7cc506a82ae8aa0fa0d1df8c478f51 | [
"MIT"
] | null | null | null | from Server.database.database import Database
db = Database() | 20.666667 | 45 | 0.806452 |
8c281c1f13f4800a461be9826bf79fa1ce08935d | 1,304 | py | Python | data/model/test/test_modelutil.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | 1 | 2020-10-16T19:30:41.000Z | 2020-10-16T19:30:41.000Z | data/model/test/test_modelutil.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | 15 | 2020-06-18T15:32:06.000Z | 2022-03-03T23:06:24.000Z | data/model/test/test_modelutil.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | import pytest
from data.database import Role
from data.model.modelutil import paginate
from test.fixtures import *
@pytest.mark.parametrize("page_size", [10, 20, 50, 100, 200, 500, 1000,])
@pytest.mark.parametrize("descending", [False, True,])
def test_paginate(page_size, descending, initialized_db):
# Add a bun... | 31.047619 | 86 | 0.641104 |
2173fe30bc7d05af0732eadcc048313b5154345e | 8,984 | py | Python | pygmt/src/grd2cpt.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 326 | 2019-02-13T09:33:39.000Z | 2022-03-25T17:24:05.000Z | pygmt/src/grd2cpt.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 1,153 | 2019-01-22T19:14:32.000Z | 2022-03-31T22:07:03.000Z | pygmt/src/grd2cpt.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 160 | 2019-02-10T15:24:19.000Z | 2022-03-31T09:07:41.000Z | """
grd2cpt - Create a CPT from a grid file.
"""
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import build_arg_string, fmt_docstring, kwargs_to_strings, use_alias
@fmt_docstring
@use_alias(
A="transparency",
C="cmap",
D="background",
F="color_model",
... | 50.47191 | 87 | 0.659394 |
b4d01c1bda41d7c249f26e6b0d3d0d124cddf0a2 | 3,268 | py | Python | tensorflow_book/c4/regression.py | imrocky1976/ML-AI | 3f8058ae6464c72bfab1a8fca429865b7b48f3fb | [
"MIT"
] | null | null | null | tensorflow_book/c4/regression.py | imrocky1976/ML-AI | 3f8058ae6464c72bfab1a8fca429865b7b48f3fb | [
"MIT"
] | null | null | null | tensorflow_book/c4/regression.py | imrocky1976/ML-AI | 3f8058ae6464c72bfab1a8fca429865b7b48f3fb | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import tensorflow as tf
import os
import numpy as np
#初始化变量和模型参数,定义训练闭环中的运算
W = tf.Variable(tf.zeros([1]), name="weights") # W = tf.Variable(tf.zeros([2, 1]), name="weights")
b = tf.Variable(0., name="bias")
def inference(X):
""" 计算推断模型在数据X上的输出,并将结果返回
"""
return tf.multiply(X, W) ... | 27.008264 | 98 | 0.578335 |
49e0b69e5612e1b5eeda1962a7ce7147e08c9544 | 278 | py | Python | consumers/venv/lib/python3.7/site-packages/faust/livecheck/__init__.py | spencerpomme/Public-Transit-Status-with-Apache-Kafka | 2c85d7daadf4614fe7ce2eabcd13ff87236b1c7e | [
"MIT"
] | null | null | null | consumers/venv/lib/python3.7/site-packages/faust/livecheck/__init__.py | spencerpomme/Public-Transit-Status-with-Apache-Kafka | 2c85d7daadf4614fe7ce2eabcd13ff87236b1c7e | [
"MIT"
] | null | null | null | consumers/venv/lib/python3.7/site-packages/faust/livecheck/__init__.py | spencerpomme/Public-Transit-Status-with-Apache-Kafka | 2c85d7daadf4614fe7ce2eabcd13ff87236b1c7e | [
"MIT"
] | null | null | null | """LiveCheck - End-to-end testing of asynchronous systems."""
from .app import LiveCheck
from .case import Case
from .locals import current_test
from .runners import TestRunner
from .signals import Signal
__all__ = ['LiveCheck', 'Case', 'Signal', 'TestRunner', 'current_test']
| 30.888889 | 71 | 0.758993 |
3353c907e90193396f23fd038090ace81aa976ff | 5,108 | py | Python | assignment2-6/problem2.py | venn0605/computer-vison-1 | 3fc782350b0cab1357b89e152e5e7c7df1074ac6 | [
"Apache-2.0"
] | 2 | 2022-01-17T01:57:30.000Z | 2022-01-17T01:57:32.000Z | assignment2-6/problem2.py | venn0605/computer-vison-1 | 3fc782350b0cab1357b89e152e5e7c7df1074ac6 | [
"Apache-2.0"
] | null | null | null | assignment2-6/problem2.py | venn0605/computer-vison-1 | 3fc782350b0cab1357b89e152e5e7c7df1074ac6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os
from PIL import Image
def load_faces(path, ext=".pgm"):
"""Load faces into an array (N, H, W),
where N is the number of face images and
H, W are height and width of the images.
Hint: os.walk() supports recursive listing of files
and directories in a path
... | 27.315508 | 91 | 0.61159 |
07cf1fe983e11ad3a8089dbe08e6efb3d551393f | 2,479 | py | Python | sql.py | Fog-Forest/douban-movie-crawler | ef8d0442a10fcadc65ed9a9cdefc1e807cd32cf9 | [
"MIT"
] | 1 | 2021-04-28T06:49:50.000Z | 2021-04-28T06:49:50.000Z | sql.py | Fog-Forest/douban-movie-crawler | ef8d0442a10fcadc65ed9a9cdefc1e807cd32cf9 | [
"MIT"
] | null | null | null | sql.py | Fog-Forest/douban-movie-crawler | ef8d0442a10fcadc65ed9a9cdefc1e807cd32cf9 | [
"MIT"
] | 1 | 2020-08-09T23:01:37.000Z | 2020-08-09T23:01:37.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import mysql.connector
host = "localhost" # 数据库主机地址
user = "root" # 数据库用户名
passwd = "root" # 数据库密码
database = "movie" # 数据库名
# 创建数据库
def create_db():
db = mysql.connector.connect(host=host, user=user, passwd=passwd) # 打开数据库连接
cursor = db.cursor() # 创建游标对象
... | 36.455882 | 121 | 0.588947 |
875f743546d92f678cd7e9f157730fb2b37d73bf | 6,171 | py | Python | CodeInstrumentator.py | MisterAI/AutoTeSG | 7a53b96964e4a51c55c244dfd5466fe092f4f9e0 | [
"MIT"
] | null | null | null | CodeInstrumentator.py | MisterAI/AutoTeSG | 7a53b96964e4a51c55c244dfd5466fe092f4f9e0 | [
"MIT"
] | null | null | null | CodeInstrumentator.py | MisterAI/AutoTeSG | 7a53b96964e4a51c55c244dfd5466fe092f4f9e0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from ast import *
import astor
class RemovePrintStmts(NodeTransformer):
"""
Removes all print statements so they don't interfere
with the instrumentation
"""
def visit_Print(self, node):
new_node = []
for i_node in node.values:
new_node.append(Expr(value=i_node, ctx=Load()))
copy_loc... | 26.599138 | 91 | 0.640415 |
268bab94a70040847a53eb0baa9f01f661486bbd | 7,131 | py | Python | dataworkspace/dataworkspace/apps/explorer/tasks.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | 1 | 2019-06-10T08:22:56.000Z | 2019-06-10T08:22:56.000Z | dataworkspace/dataworkspace/apps/explorer/tasks.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | 2 | 2019-05-17T13:10:42.000Z | 2019-06-17T10:48:46.000Z | dataworkspace/dataworkspace/apps/explorer/tasks.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from time import time
import psycopg2
from celery.utils.log import get_task_logger
from django.contrib.auth import get_user_model
from django.core.cache import cache
from django.db import connections
from pytz import utc
from dataworkspace.apps.core.utils import (
USER_SC... | 35.834171 | 98 | 0.677324 |
764021611313ab28d6fd726e1a008c63338aab08 | 3,586 | py | Python | bitcoin_price/settings.py | tbyacoub/coinmenabackend | 8b57a282a3f7b72d392d42020ed00cd8f7fa62be | [
"CC0-1.0"
] | null | null | null | bitcoin_price/settings.py | tbyacoub/coinmenabackend | 8b57a282a3f7b72d392d42020ed00cd8f7fa62be | [
"CC0-1.0"
] | null | null | null | bitcoin_price/settings.py | tbyacoub/coinmenabackend | 8b57a282a3f7b72d392d42020ed00cd8f7fa62be | [
"CC0-1.0"
] | null | null | null | """
Django settings for bitcoin_price project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from p... | 27.79845 | 91 | 0.694646 |
4a55c5cab0dd8a46e18707cc8c375d9f6bff79d6 | 18,605 | py | Python | byteps/tensorflow/__init__.py | ruipeterpan/byteps | 67369692ba43de972560612d60c364f1fd8eee3d | [
"Apache-2.0"
] | null | null | null | byteps/tensorflow/__init__.py | ruipeterpan/byteps | 67369692ba43de972560612d60c364f1fd8eee3d | [
"Apache-2.0"
] | null | null | null | byteps/tensorflow/__init__.py | ruipeterpan/byteps | 67369692ba43de972560612d60c364f1fd8eee3d | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Bytedance Inc. All Rights Reserved.
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications copyright (C) 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | 44.723558 | 95 | 0.629669 |
6e5acb4c8253817f37e030026039bcb24ecc1c89 | 1,945 | py | Python | rasa/core/visualize.py | anoop2503/rasa | 990bab95954a2f6605f039ce9fb1317b39858651 | [
"Apache-2.0"
] | 1 | 2021-07-06T20:49:07.000Z | 2021-07-06T20:49:07.000Z | rasa/core/visualize.py | anoop2503/rasa | 990bab95954a2f6605f039ce9fb1317b39858651 | [
"Apache-2.0"
] | null | null | null | rasa/core/visualize.py | anoop2503/rasa | 990bab95954a2f6605f039ce9fb1317b39858651 | [
"Apache-2.0"
] | 1 | 2020-01-13T14:54:22.000Z | 2020-01-13T14:54:22.000Z | import argparse
import asyncio
import logging
import os
from typing import Text
import rasa.utils.io
import rasa.core.cli
import rasa.core.cli.arguments
import rasa.core.cli.train
logger = logging.getLogger(__name__)
def add_arguments(parser: argparse.ArgumentParser):
"""Parse all the command line arguments for... | 27.394366 | 82 | 0.720308 |
58fff6418a10a810d75395c55fc95b9b9e897205 | 2,065 | py | Python | tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_testing.py | thiagoss/grpc | 3eb743ba4c9e38941aeac3a54420628b46335d20 | [
"Apache-2.0"
] | null | null | null | tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_testing.py | thiagoss/grpc | 3eb743ba4c9e38941aeac3a54420628b46335d20 | [
"Apache-2.0"
] | null | null | null | tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_testing.py | thiagoss/grpc | 3eb743ba4c9e38941aeac3a54420628b46335d20 | [
"Apache-2.0"
] | 1 | 2021-03-25T09:20:49.000Z | 2021-03-25T09:20:49.000Z | # Copyright 2020 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 38.240741 | 77 | 0.68523 |
01fa933ff3cf055d54e76aea1d31cfc730d35ab9 | 2,444 | py | Python | tools/perf/scripts/python/stat-cpi.py | fergy/aplit_linux-5 | a6ef4cb0e17e1eec9743c064e65f730c49765711 | [
"MIT"
] | 44 | 2022-03-16T08:32:31.000Z | 2022-03-31T16:02:35.000Z | tools/perf/scripts/python/stat-cpi.py | fergy/aplit_linux-5 | a6ef4cb0e17e1eec9743c064e65f730c49765711 | [
"MIT"
] | 13 | 2021-07-10T04:36:17.000Z | 2022-03-03T10:50:05.000Z | tools/perf/scripts/python/stat-cpi.py | fergy/aplit_linux-5 | a6ef4cb0e17e1eec9743c064e65f730c49765711 | [
"MIT"
] | 18 | 2022-03-19T04:41:04.000Z | 2022-03-31T03:32:12.000Z | # SPDX-License-Identifier: GPL-2.0
from __future__ import print_function
data = {}
times = []
threads = []
cpus = []
def get_key(time, event, cpu, thread):
return "%d-%s-%d-%d" % (time, event, cpu, thread)
def store_key(time, cpu, thread):
if (time not in times):
times.append(time)
if (... | 30.55 | 119 | 0.584697 |
e865701d3029b0099e2051f38928492099166795 | 20,896 | py | Python | test/cortex_test.py | juhhov/pyOCD | 0965f7f038622ef1d933af5c6916c482a28244ff | [
"Apache-2.0"
] | 1 | 2020-07-11T09:24:25.000Z | 2020-07-11T09:24:25.000Z | test/cortex_test.py | ARMmbed/pyOCD-Samsung | 03242b6eb57d2170a4b531d00f1a0577e2b0abde | [
"Apache-2.0"
] | null | null | null | test/cortex_test.py | ARMmbed/pyOCD-Samsung | 03242b6eb57d2170a4b531d00f1a0577e2b0abde | [
"Apache-2.0"
] | null | null | null | # pyOCD debugger
# Copyright (c) 2015-2019 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... | 38.840149 | 130 | 0.590831 |
e290d72190c85a19a3b96941c4dd34286957d91b | 1,302 | py | Python | Q03__/79_Design_Phone_Directory/Solution.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | Q03__/79_Design_Phone_Directory/Solution.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | Q03__/79_Design_Phone_Directory/Solution.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | class PhoneDirectory:
def __init__(self, maxNumbers: int):
"""
Initialize your data structure here
@param maxNumbers - The maximum numbers that can be stored in the phone directory.
"""
self.numsAvailable = set( range(maxNumbers) )
self.numsUsed = set()
def get... | 26.571429 | 90 | 0.573733 |
9cfc35df1c91de3a2140ba0f76a824286f27c071 | 742 | py | Python | redeNeural.py | felipemohamed/I.A-ANACONDA | f6c5fc3d94e14ab65ed17832b39dc119dc86505d | [
"MIT"
] | null | null | null | redeNeural.py | felipemohamed/I.A-ANACONDA | f6c5fc3d94e14ab65ed17832b39dc119dc86505d | [
"MIT"
] | null | null | null | redeNeural.py | felipemohamed/I.A-ANACONDA | f6c5fc3d94e14ab65ed17832b39dc119dc86505d | [
"MIT"
] | null | null | null |
# Created on Thu Jun 4 10:31:30 2020
# @author: FelipeMohamed
# código com aumento de performace com adições
# import NUMPY-Código que aumeta a velocidade resposta com 'dot',
# aumentando sua performace
''' CÓDIGO QUE TEM MAIOR PERFORMACE SEM IMPORT NUMPY
# entradas=[1,7,5]
# pesos=[0.8, 0.1, 0]
'''
import nump... | 20.611111 | 79 | 0.642857 |
32a64a1f8748db49dd6265ba46921e906593cf19 | 5,794 | py | Python | api/app/resources/theq/citizen/citizen_detail.py | krishnan-aot/queue-management | 0710ef268b288feeb7776882e618f974d4b84f6f | [
"Apache-2.0"
] | 30 | 2018-09-19T03:30:51.000Z | 2022-03-07T02:57:05.000Z | api/app/resources/theq/citizen/citizen_detail.py | WalterMoar/queue-management | c7698501dafebe3b5dc6bb602b5ab57ca56572a7 | [
"Apache-2.0"
] | 159 | 2018-09-17T23:45:58.000Z | 2022-03-30T17:35:05.000Z | api/app/resources/theq/citizen/citizen_detail.py | tyu-avo/queue-management | 0710ef268b288feeb7776882e618f974d4b84f6f | [
"Apache-2.0"
] | 52 | 2018-05-18T18:30:06.000Z | 2021-08-25T12:00:29.000Z | '''Copyright 2018 Province of British Columbia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | 46.352 | 133 | 0.633069 |
505c7df4522959f282194d1c9f16533386db0ef7 | 970 | py | Python | python-modules/robcoewmrobotconfigurator/setup.py | isabella232/ewm-cloud-robotics | 8210843df323379ded92ec14ec73b1f3ef6b2f41 | [
"Apache-2.0"
] | null | null | null | python-modules/robcoewmrobotconfigurator/setup.py | isabella232/ewm-cloud-robotics | 8210843df323379ded92ec14ec73b1f3ef6b2f41 | [
"Apache-2.0"
] | 1 | 2022-02-27T19:06:41.000Z | 2022-02-27T19:06:41.000Z | python-modules/robcoewmrobotconfigurator/setup.py | isabella232/ewm-cloud-robotics | 8210843df323379ded92ec14ec73b1f3ef6b2f41 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
#
# This file is part of ewm-cloud-robotics
# (see https://github.com/SAP/ewm-cloud-robotics).
#
# This file is licensed under the Apache Software License, v. 2 except as noted
# otherwise in the LIC... | 27.714286 | 95 | 0.703093 |
d1faebfe9d4888656ad513fab2f607cfd381415d | 117 | py | Python | examples/mvc/__init__.py | agoose77/spectate | a70d8e3fb8e9e3f053cb2a1c5a4c760df0d61cb3 | [
"MIT"
] | null | null | null | examples/mvc/__init__.py | agoose77/spectate | a70d8e3fb8e9e3f053cb2a1c5a4c760df0d61cb3 | [
"MIT"
] | null | null | null | examples/mvc/__init__.py | agoose77/spectate | a70d8e3fb8e9e3f053cb2a1c5a4c760df0d61cb3 | [
"MIT"
] | null | null | null | import sys
if sys.version_info < (3, 6):
raise ImportError("Python 3.6 or greater required.")
else:
del sys
| 16.714286 | 56 | 0.675214 |
fd322e619633e360629bb87351dfb34c4f37f26a | 4,520 | py | Python | google/ads/google_ads/v4/proto/enums/ad_network_type_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v4/proto/enums/ad_network_type_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v4/proto/enums/ad_network_type_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v4/proto/enums/ad_network_type.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import ... | 38.305085 | 776 | 0.768584 |
c7b44dbece0312af4f5dbe4117c85c1cb74a3e17 | 8,672 | py | Python | releasenotes/source/conf.py | openstack/murano | 314c85db8addae184a77c8b47217b1f28e4a1b67 | [
"Apache-2.0"
] | 91 | 2015-04-26T16:05:03.000Z | 2021-12-28T07:12:33.000Z | releasenotes/source/conf.py | openstack/murano | 314c85db8addae184a77c8b47217b1f28e4a1b67 | [
"Apache-2.0"
] | 3 | 2016-06-24T08:05:20.000Z | 2021-02-07T06:04:47.000Z | releasenotes/source/conf.py | openstack/murano | 314c85db8addae184a77c8b47217b1f28e4a1b67 | [
"Apache-2.0"
] | 61 | 2015-05-19T22:56:34.000Z | 2021-06-01T05:38:53.000Z | # -*- coding: utf-8 -*-
# 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, software... | 33.099237 | 79 | 0.719211 |
9c0cde866a044146dae79e288523706c6006bc39 | 1,529 | py | Python | tests/adapters/compliance_tests/unset_interface_mtu_test.py | FrancoisLopez/netman | a40d3235f7ea0cdaf52daab97b0d5ad20857b00e | [
"Apache-2.0"
] | 38 | 2015-11-30T10:11:42.000Z | 2022-02-10T18:31:44.000Z | tests/adapters/compliance_tests/unset_interface_mtu_test.py | FrancoisLopez/netman | a40d3235f7ea0cdaf52daab97b0d5ad20857b00e | [
"Apache-2.0"
] | 143 | 2015-12-10T19:00:42.000Z | 2020-08-20T13:51:42.000Z | tests/adapters/compliance_tests/unset_interface_mtu_test.py | idjaw/netman | 58ba898de6e450a24b4f1721ce274ad3e12f9d33 | [
"Apache-2.0"
] | 15 | 2015-12-14T23:03:30.000Z | 2019-01-15T19:35:45.000Z | # Copyright 2016 Internap.
#
# 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, so... | 35.55814 | 82 | 0.760628 |
7f3913ad526ef9d614b9ef3236adf3bdcaa6f600 | 557 | py | Python | mmdet3d/core/bbox/structures/__init__.py | Shudeng/hgnn_mmdet | eb93fc576bf110d3a5c90b4bb9356edaf9306c3e | [
"Apache-2.0"
] | 12 | 2021-03-17T09:07:18.000Z | 2022-01-21T01:37:42.000Z | mmdet3d/core/bbox/structures/__init__.py | Shudeng/hgnn_mmdet | eb93fc576bf110d3a5c90b4bb9356edaf9306c3e | [
"Apache-2.0"
] | 1 | 2020-08-11T05:44:29.000Z | 2020-08-11T05:44:29.000Z | mmdet3d/core/bbox/structures/__init__.py | Shudeng/hgnn_mmdet | eb93fc576bf110d3a5c90b4bb9356edaf9306c3e | [
"Apache-2.0"
] | 2 | 2021-03-17T09:25:15.000Z | 2021-04-22T09:15:58.000Z | from .base_box3d import BaseInstance3DBoxes
from .box_3d_mode import Box3DMode
from .cam_box3d import CameraInstance3DBoxes
from .depth_box3d import DepthInstance3DBoxes
from .lidar_box3d import LiDARInstance3DBoxes
from .utils import (get_box_type, limit_period, points_cam2img,
rotation_3d_in_axis,... | 39.785714 | 75 | 0.786355 |
ce58227b65823c496159d2858ea4a21ae74a2f0e | 5,609 | py | Python | ote_sdk/ote_sdk/tests/entities/test_label.py | bes-dev/training_extensions | 7b016e3bd02ae7c74d60fd5a0ae0912a42ef87cb | [
"Apache-2.0"
] | 775 | 2019-03-01T02:13:33.000Z | 2020-09-07T22:49:15.000Z | ote_sdk/ote_sdk/tests/entities/test_label.py | bes-dev/training_extensions | 7b016e3bd02ae7c74d60fd5a0ae0912a42ef87cb | [
"Apache-2.0"
] | 229 | 2019-02-28T21:37:08.000Z | 2020-09-07T15:11:49.000Z | ote_sdk/ote_sdk/tests/entities/test_label.py | bes-dev/training_extensions | 7b016e3bd02ae7c74d60fd5a0ae0912a42ef87cb | [
"Apache-2.0"
] | 290 | 2019-02-28T20:32:11.000Z | 2020-09-07T05:51:41.000Z | # Copyright (C) 2021 Intel 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 in wri... | 30.650273 | 80 | 0.630415 |
b50dbd77a83697e31c0e4fc69022dc98b1fb259c | 189 | py | Python | tests/samples/valid/DictAchievement.py | raviolliii/dev-achievements | da0a92f0d53b20192ef68ee1222cbf01fb0c0ed0 | [
"MIT"
] | 12 | 2021-02-05T15:38:08.000Z | 2021-09-04T21:19:03.000Z | tests/samples/valid/DictAchievement.py | raviolliii/dev-achievements | da0a92f0d53b20192ef68ee1222cbf01fb0c0ed0 | [
"MIT"
] | null | null | null | tests/samples/valid/DictAchievement.py | raviolliii/dev-achievements | da0a92f0d53b20192ef68ee1222cbf01fb0c0ed0 | [
"MIT"
] | null | null | null | # cases where DictAchievement should unlock
# >> CASE
{'name': 'John Doe', 'age': 24}
# >> CASE
{
'name': 'John Doe',
'age': 24
}
# >> CASE
func({'name': 'John Doe', 'age': 24})
| 13.5 | 43 | 0.534392 |
22672a35e7a7e000a1f0ab1041d1a8564ceef6f0 | 2,376 | py | Python | ZZZ_OtherDemo/00-dyld-832.7.3/testing/kernel-cache-tests/packed-kext-text/test.py | 1079278593/TreasureChest | 8b1ebe04ed7c2ed399c4ecf3b75b3fee0a1aced8 | [
"MIT"
] | null | null | null | ZZZ_OtherDemo/00-dyld-832.7.3/testing/kernel-cache-tests/packed-kext-text/test.py | 1079278593/TreasureChest | 8b1ebe04ed7c2ed399c4ecf3b75b3fee0a1aced8 | [
"MIT"
] | null | null | null | ZZZ_OtherDemo/00-dyld-832.7.3/testing/kernel-cache-tests/packed-kext-text/test.py | 1079278593/TreasureChest | 8b1ebe04ed7c2ed399c4ecf3b75b3fee0a1aced8 | [
"MIT"
] | null | null | null | #!/usr/bin/python2.7
import os
import KernelCollection
# __DATA should be packed at sub-page alignment
# But only in the kexts. The kernel pages should not be packed
def check(kernel_cache):
kernel_cache.buildKernelCollection("arm64", "/packed-kext-text/main.kc", "/packed-kext-text/main.kernel", "/packed-kext-t... | 59.4 | 227 | 0.679714 |
e0732a94db6f461075874fd0b02adc431c88854b | 17,289 | py | Python | python/ccxt/coincheck.py | EdwinSchrubb/ccxt | b134ce6ffad54c69ceaa872b07c71ca07e7d3a1a | [
"MIT"
] | 1 | 2020-08-07T08:02:16.000Z | 2020-08-07T08:02:16.000Z | python/ccxt/coincheck.py | EdwinSchrubb/ccxt | b134ce6ffad54c69ceaa872b07c71ca07e7d3a1a | [
"MIT"
] | null | null | null | python/ccxt/coincheck.py | EdwinSchrubb/ccxt | b134ce6ffad54c69ceaa872b07c71ca07e7d3a1a | [
"MIT"
] | 2 | 2020-05-11T12:51:40.000Z | 2020-05-26T11:19:55.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import BadSymbol
class coincheck... | 44.217391 | 154 | 0.483891 |
26acad4ef40197908649452921ce8f06365e0474 | 385 | py | Python | test.py | heisenberg-cat/twitch-utils | cf9f14c88f11608e0814691eabbb9b97b03c8890 | [
"Apache-2.0"
] | null | null | null | test.py | heisenberg-cat/twitch-utils | cf9f14c88f11608e0814691eabbb9b97b03c8890 | [
"Apache-2.0"
] | null | null | null | test.py | heisenberg-cat/twitch-utils | cf9f14c88f11608e0814691eabbb9b97b03c8890 | [
"Apache-2.0"
] | null | null | null | import os
import unittest
class MyTestCase(unittest.TestCase):
def test_token(self):
import twitch_utils.auth as auth
d = auth.Auth("heisenberg_cat")
d.make_oauth_token()
self.assertEqual(
os.environ["TWITCH_CLIENT_ID"], d.validate_token()["client_id"]
) # add... | 21.388889 | 75 | 0.644156 |
ab32a0437061a40d4a434a276255b91e3c8df306 | 1,126 | py | Python | doc/python_api/examples/bpy.types.Panel.1.py | wycivil08/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 30 | 2015-01-29T14:06:05.000Z | 2022-01-10T07:47:29.000Z | doc/python_api/examples/bpy.types.Panel.1.py | ttagu99/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 1 | 2017-02-20T20:57:48.000Z | 2018-12-19T23:44:38.000Z | doc/python_api/examples/bpy.types.Panel.1.py | ttagu99/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 15 | 2015-04-23T02:38:36.000Z | 2021-03-01T20:09:39.000Z | """
Simple Object Panel
+++++++++++++++++++
This panel has a :class:`Panel.poll` and :class:`Panel.draw_header` function,
even though the contents is basic this closely resemples blenders panels.
"""
import bpy
class ObjectSelectPanel(bpy.types.Panel):
bl_idname = "OBJECT_PT_select"
bl_label = "Select"
bl... | 25.590909 | 77 | 0.634103 |
62dde2116e459432beca16d59822202fbe3997c3 | 633 | py | Python | backend/manage.py | crowdbotics-apps/bhstaff-33865 | c6bebb62a8bb052024e9f3b4a897f64c035e9b96 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/bhstaff-33865 | c6bebb62a8bb052024e9f3b4a897f64c035e9b96 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/bhstaff-33865 | c6bebb62a8bb052024e9f3b4a897f64c035e9b96 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bhstaff_33865.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ... | 28.772727 | 77 | 0.685624 |
535e3b1ef743e6fcebdef2284f57b8152dd2c50d | 4,609 | py | Python | google/ads/googleads/v7/services/types/ad_group_label_service.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 285 | 2018-10-05T16:47:58.000Z | 2022-03-31T00:58:39.000Z | google/ads/googleads/v7/services/types/ad_group_label_service.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 425 | 2018-09-10T13:32:41.000Z | 2022-03-31T14:50:05.000Z | google/ads/googleads/v7/services/types/ad_group_label_service.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 369 | 2018-11-28T07:01:00.000Z | 2022-03-28T09:53:22.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 34.916667 | 120 | 0.683445 |
e0099364c38d7821c291b0b09982d862e4039bb2 | 1,335 | py | Python | src/utils.py | rodrigofegui/IA-proj1 | 75d4d46b8ac53c8cb65f63d754ede81a9365e3ab | [
"MIT"
] | null | null | null | src/utils.py | rodrigofegui/IA-proj1 | 75d4d46b8ac53c8cb65f63d754ede81a9365e3ab | [
"MIT"
] | 5 | 2020-09-10T18:21:40.000Z | 2020-09-17T18:34:50.000Z | src/utils.py | rodrigofegui/IA-proj1 | 75d4d46b8ac53c8cb65f63d754ede81a9365e3ab | [
"MIT"
] | 1 | 2020-12-03T17:06:41.000Z | 2020-12-03T17:06:41.000Z | from random import shuffle
import variables
from variables import CODED_CITIES, DISTANCES, STABILITY_MAX, STABILITY_PERC
def reached_stability(generation):
if not variables.avg_distance or variables.found_new_min:
variables.stability_cnt = 0
return False
c_diff = variables.distance_range / ... | 24.272727 | 96 | 0.674906 |
2f061855da1ed731c90ac84b39e2a6cea46a4767 | 104,983 | py | Python | superset/viz.py | neelam123-a/superset | 2e32dd8c6842287588fd649dc8c6c57dd3afa985 | [
"Apache-2.0"
] | null | null | null | superset/viz.py | neelam123-a/superset | 2e32dd8c6842287588fd649dc8c6c57dd3afa985 | [
"Apache-2.0"
] | null | null | null | superset/viz.py | neelam123-a/superset | 2e32dd8c6842287588fd649dc8c6c57dd3afa985 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.163033 | 88 | 0.555004 |
5794dd7f7451f6d1c5fffa55719dea9ba03bd82f | 31,266 | py | Python | scielomanager/journalmanager/migrations/0049_normalizacao_de_codigos_de_use_license.py | jamilatta/scielo-manager | d506c6828ba9b1089faa164bc42ba29a0f228e61 | [
"BSD-2-Clause"
] | null | null | null | scielomanager/journalmanager/migrations/0049_normalizacao_de_codigos_de_use_license.py | jamilatta/scielo-manager | d506c6828ba9b1089faa164bc42ba29a0f228e61 | [
"BSD-2-Clause"
] | null | null | null | scielomanager/journalmanager/migrations/0049_normalizacao_de_codigos_de_use_license.py | jamilatta/scielo-manager | d506c6828ba9b1089faa164bc42ba29a0f228e61 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
try:
use_license_code_nd = orm.UseLicense.objects.get(license_code='nd')
... | 86.132231 | 256 | 0.570236 |
0a34bea54f6061641904a99feacbe8c226427a18 | 48,273 | py | Python | discord/ext/commands/help.py | Kenvyra/discord.py | fe5e595239833c306e667916b47f88c6f15c309d | [
"MIT"
] | null | null | null | discord/ext/commands/help.py | Kenvyra/discord.py | fe5e595239833c306e667916b47f88c6f15c309d | [
"MIT"
] | null | null | null | discord/ext/commands/help.py | Kenvyra/discord.py | fe5e595239833c306e667916b47f88c6f15c309d | [
"MIT"
] | 1 | 2020-10-01T15:44:02.000Z | 2020-10-01T15:44:02.000Z | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2020 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | 34.980435 | 116 | 0.614691 |
5541643424427ffa1eb51004ed18f77da39bb501 | 589 | py | Python | asyncioEcho.py | Stang-wm/CS305 | 3f927708f6e018bc0cd1f4f77b12c7e7cecf06d5 | [
"WTFPL"
] | null | null | null | asyncioEcho.py | Stang-wm/CS305 | 3f927708f6e018bc0cd1f4f77b12c7e7cecf06d5 | [
"WTFPL"
] | null | null | null | asyncioEcho.py | Stang-wm/CS305 | 3f927708f6e018bc0cd1f4f77b12c7e7cecf06d5 | [
"WTFPL"
] | null | null | null | import asyncio
async def handle_echo(reader, writer):
data = await reader.read(100)
message = data.decode()
print(message)
writer.write(data)
await writer.drain()
await asyncio.sleep(1)
print("Close the connection")
writer.close()
async def main():
server = await asyncio.start_se... | 23.56 | 71 | 0.667233 |
82ed1088cd7bfc22b82789c9a4896631525d3c9c | 4,930 | py | Python | runlmc/lmc/grid_kernel.py | vlad17/run-lmc | bddb7df2aa3dcec17380d858325bf50502fffb4e | [
"BSD-3-Clause"
] | 29 | 2017-06-13T21:45:54.000Z | 2021-12-15T02:03:10.000Z | runlmc/lmc/grid_kernel.py | vlad17/run-lmc | bddb7df2aa3dcec17380d858325bf50502fffb4e | [
"BSD-3-Clause"
] | 3 | 2020-06-11T02:34:23.000Z | 2022-02-26T18:03:45.000Z | runlmc/lmc/grid_kernel.py | vlad17/run-lmc | bddb7df2aa3dcec17380d858325bf50502fffb4e | [
"BSD-3-Clause"
] | 9 | 2017-03-12T16:36:56.000Z | 2021-03-02T05:10:36.000Z | # Copyright (c) 2016, Vladimir Feinberg
# Licensed under the BSD 3-clause license (see LICENSE)
import numpy as np
from ..approx.ski import SKI
from ..linalg.diag import Diag
from ..linalg.block_diag import BlockDiag
from ..linalg.block_matrix import SymmSquareBlockMatrix
from ..linalg.matrix import Matrix
from ..lin... | 35.985401 | 79 | 0.665112 |
c9b823cff051703595f6964c01a5a86504a91eee | 4,903 | py | Python | software/computervision/parseobj.py | jackylee0424/YCHack-MakeHAL9000 | 2fe50a2292d6c6615c75ad5ad6f8c4851527834f | [
"MIT"
] | 2 | 2015-06-24T14:01:20.000Z | 2021-02-10T03:27:40.000Z | software/computervision/parseobj.py | jackylee0424/YCHack-MakeHAL9000 | 2fe50a2292d6c6615c75ad5ad6f8c4851527834f | [
"MIT"
] | null | null | null | software/computervision/parseobj.py | jackylee0424/YCHack-MakeHAL9000 | 2fe50a2292d6c6615c75ad5ad6f8c4851527834f | [
"MIT"
] | 1 | 2015-06-24T14:01:22.000Z | 2015-06-24T14:01:22.000Z | import os
import subprocess
import cv2
import thread
import pickle
import time
import requests
import json
#block_list = []
block_dict = dict()
url = "https://timeseriesvisual.firebaseio.com/.json"
if not os.path.exists("data"):
os.makedirs("data")
# remove old block
#if os.path.exists(os.path.join('data', "bloc... | 36.051471 | 177 | 0.620233 |
0745714a4a590885bc82a59a0114d114ab017666 | 2,864 | py | Python | fig1-2_adaptation/fig1_2_test.py | sjx93/rnn_for_gene_network_2020 | d2e16d836f35321923660777179e260065e3976c | [
"MIT"
] | 5 | 2021-04-20T14:43:51.000Z | 2022-02-09T07:43:11.000Z | fig1-2_adaptation/fig1_2_test.py | sjx93/rnn_for_gene_network_2020 | d2e16d836f35321923660777179e260065e3976c | [
"MIT"
] | null | null | null | fig1-2_adaptation/fig1_2_test.py | sjx93/rnn_for_gene_network_2020 | d2e16d836f35321923660777179e260065e3976c | [
"MIT"
] | 1 | 2022-02-02T09:23:20.000Z | 2022-02-02T09:23:20.000Z | import argparse
import sys
import csv
import os
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from rnn_models import rnn_fig1
FLAGS = None
N_CASES = 20
Gs = 2 # num of dynamic nodes (genes)
Gin= 1 # num of input signal
TIMESTEP = 0.1 # smaller timestep for test runs
time_points = 150
def... | 33.302326 | 121 | 0.706355 |
441bd602f856bedb54cbb3fbcbac4223771b796e | 779 | py | Python | backoffice/models/group.py | MedPy-C/backend | 262834adb1f4f5714c4bd490595fdfa1f49c9675 | [
"MIT"
] | null | null | null | backoffice/models/group.py | MedPy-C/backend | 262834adb1f4f5714c4bd490595fdfa1f49c9675 | [
"MIT"
] | 1 | 2021-05-20T16:08:35.000Z | 2021-05-20T16:08:35.000Z | backoffice/models/group.py | MedPy-C/backend | 262834adb1f4f5714c4bd490595fdfa1f49c9675 | [
"MIT"
] | null | null | null | import uuid
from django.db import models
from backoffice.manager import group
from backoffice.models import UpdatedCreated, UserLogin
class Group(UpdatedCreated):
group_code = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(max_length=200)
slug_name = model... | 35.409091 | 103 | 0.765083 |
c475930193be0fc97d98944d855cd9df2e587ccb | 13,161 | py | Python | script/generate_seg_labels.py | elephant-track/elephant-server | 8935febdbcb2e2d6ba2220ca139e765db44e6458 | [
"BSD-2-Clause"
] | 3 | 2021-10-05T15:04:15.000Z | 2021-12-23T22:57:49.000Z | script/generate_seg_labels.py | elephant-track/elephant-server | 8935febdbcb2e2d6ba2220ca139e765db44e6458 | [
"BSD-2-Clause"
] | 3 | 2021-05-10T19:13:53.000Z | 2021-10-19T22:38:36.000Z | script/generate_seg_labels.py | elephant-track/elephant-server | 8935febdbcb2e2d6ba2220ca139e765db44e6458 | [
"BSD-2-Clause"
] | 4 | 2021-02-28T15:22:09.000Z | 2021-03-04T23:00:10.000Z | #! /usr/bin/env python
# ==============================================================================
# Copyright (c) 2021, Ko Sugawara
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Re... | 40.74613 | 80 | 0.439708 |
8eb7278bfdccdf625af52d16f40fe908504f2e0d | 1,271 | py | Python | modularity/DirectedLouvain/run_modularity.py | xchen034/dyson_sphere_kg | d9c6f28f5ae01f9087ecc4462e0d247640576f3e | [
"MIT"
] | null | null | null | modularity/DirectedLouvain/run_modularity.py | xchen034/dyson_sphere_kg | d9c6f28f5ae01f9087ecc4462e0d247640576f3e | [
"MIT"
] | null | null | null | modularity/DirectedLouvain/run_modularity.py | xchen034/dyson_sphere_kg | d9c6f28f5ae01f9087ecc4462e0d247640576f3e | [
"MIT"
] | null | null | null | import os
import sys
basepath = os.path.dirname(os.path.abspath(__file__))
basepath = os.path.dirname(os.path.dirname(basepath))
sys.path.append(basepath)
from modularity.DirectedLouvain.conf_parse import ModularityParse
from modularity.DirectedLouvain.multi_round import MultiCommunity
from modularity.preprocess.post... | 41 | 118 | 0.767113 |
11c9c01b7f75f0e15d64a6eda6d4ebd37eb83f16 | 10,907 | py | Python | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/relay/grammar/py3/RelayLexer.py | goswamig/training_results_v0.7 | 4278ce8a0f3d4db6b5e6054277724ca36278d7a3 | [
"Apache-2.0"
] | 48 | 2020-07-29T18:09:23.000Z | 2021-10-09T01:53:33.000Z | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/relay/grammar/py3/RelayLexer.py | goswamig/training_results_v0.7 | 4278ce8a0f3d4db6b5e6054277724ca36278d7a3 | [
"Apache-2.0"
] | 9 | 2021-04-02T02:28:07.000Z | 2022-03-26T18:23:59.000Z | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/relay/grammar/py3/RelayLexer.py | lablup/training_results_v0.7 | f5bb59aa0f8b18b602763abe47d1d24d0d54b197 | [
"Apache-2.0"
] | 42 | 2020-08-01T06:41:24.000Z | 2022-01-20T10:33:08.000Z | # Generated from /home/marisa/Work/tvm/python/tvm/relay/grammar/Relay.g4 by ANTLR 4.7.1
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2*")
buf.write("\u... | 53.729064 | 103 | 0.535711 |
ea7e2b2c200c3c7dd226dd95ad7dcb10bb4b1bae | 1,352 | py | Python | area_app/migrations/0001_initial.py | Ngina07/My-Neighbourhood | 0ff0599539fe60fa79a8123ed2cf2d580cec9ce5 | [
"Unlicense"
] | null | null | null | area_app/migrations/0001_initial.py | Ngina07/My-Neighbourhood | 0ff0599539fe60fa79a8123ed2cf2d580cec9ce5 | [
"Unlicense"
] | 4 | 2020-06-06T00:22:33.000Z | 2021-09-08T01:29:04.000Z | area_app/migrations/0001_initial.py | Ngina07/My-Neighbourhood | 0ff0599539fe60fa79a8123ed2cf2d580cec9ce5 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-12-02 09:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models
class Migration(migrations.Migration):
initial = True
dependenci... | 34.666667 | 122 | 0.614645 |
b1d5fe2eb4060b4675330c77f58b394322d8a538 | 894 | py | Python | lispy/__main__.py | jRimbault/lispy | f7a88146923b19722b3ab1085cdc35ffcbcf42e0 | [
"MIT"
] | 2 | 2020-05-28T02:25:30.000Z | 2021-02-11T11:55:44.000Z | lispy/__main__.py | jRimbault/lispy | f7a88146923b19722b3ab1085cdc35ffcbcf42e0 | [
"MIT"
] | null | null | null | lispy/__main__.py | jRimbault/lispy | f7a88146923b19722b3ab1085cdc35ffcbcf42e0 | [
"MIT"
] | null | null | null | """Should you want to run this as a module"""
import argparse
import sys
from .core import evaluate_exp
from .parser import parse
from .repl import read_eval_print_loop
def main(args):
"""Main entry point for the interpreter"""
if len(sys.argv) < 2 and sys.stdin.isatty():
sys.exit(read_eval_print_lo... | 24.162162 | 52 | 0.659955 |
07c0a81528480ef7d6bda8475519399f4af35dfa | 5,211 | py | Python | scripts/templatecount.py | metakgp/pywikibot | 28e3125167bb3ec521a25ade859d0e0afcfb1262 | [
"MIT"
] | 2 | 2017-06-19T16:48:34.000Z | 2017-07-07T14:15:28.000Z | scripts/templatecount.py | metakgp/pywikibot | 28e3125167bb3ec521a25ade859d0e0afcfb1262 | [
"MIT"
] | 11 | 2018-12-07T18:20:05.000Z | 2022-03-11T23:12:42.000Z | scripts/templatecount.py | metakgp/pywikibot | 28e3125167bb3ec521a25ade859d0e0afcfb1262 | [
"MIT"
] | 3 | 2018-12-09T10:18:35.000Z | 2020-09-12T13:50:14.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script will display the list of pages transcluding a given list of templates.
It can also be used to simply count the number of pages (rather than
listing each individually).
Syntax: python templatecount.py command [arguments]
Command line options:
-count C... | 32.166667 | 82 | 0.612358 |
db26de83f55a4df0c0698eda963d177d29ea7d14 | 3,785 | py | Python | changes/models/task.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 443 | 2015-01-03T16:28:39.000Z | 2021-04-26T16:39:46.000Z | changes/models/task.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 12 | 2015-07-30T19:07:16.000Z | 2016-11-07T23:11:21.000Z | changes/models/task.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 47 | 2015-01-09T10:04:00.000Z | 2020-11-18T17:58:19.000Z | from __future__ import absolute_import
import uuid
from datetime import datetime
from sqlalchemy import Column, DateTime, String, Integer
from sqlalchemy.schema import Index, UniqueConstraint
from changes.config import db
from changes.constants import Result, Status
from changes.db.types.enum import Enum
from change... | 40.698925 | 87 | 0.690092 |
baeaf3a0e999a521a1b357b937613304e93c82ba | 2,016 | py | Python | Encrypted Client/query/Jibril.py | albert752/PBE | 3ea7c1659df77f338f31e4d16b2323afdb26d53d | [
"MIT"
] | null | null | null | Encrypted Client/query/Jibril.py | albert752/PBE | 3ea7c1659df77f338f31e4d16b2323afdb26d53d | [
"MIT"
] | 1 | 2018-11-14T15:40:11.000Z | 2018-11-14T15:40:11.000Z | Encrypted Client/query/Jibril.py | albert752/PBE | 3ea7c1659df77f338f31e4d16b2323afdb26d53d | [
"MIT"
] | null | null | null | from Crypto.Cipher import XOR
import base64
from pprint import pprint as pp
import json
import hashlib
def encrypt_message(message, key):
cipher = XOR.new(key)
return base64.b64encode(cipher.encrypt(message)).decode('UTF-8')
def decrypt_message(criptogram, key):
cipher = XOR.new(key)
return cipher.de... | 27.616438 | 83 | 0.570437 |
166e28a5cfee5628640b0d927a3380a429ba3363 | 7,981 | py | Python | nova/tests/test_iptables_network.py | bopopescu/nova-33 | 6d3cf9010a45edb16f28b2582eafe35666381d1f | [
"Apache-2.0"
] | 1 | 2019-11-06T12:21:59.000Z | 2019-11-06T12:21:59.000Z | nova/tests/test_iptables_network.py | bopopescu/nova-33 | 6d3cf9010a45edb16f28b2582eafe35666381d1f | [
"Apache-2.0"
] | null | null | null | nova/tests/test_iptables_network.py | bopopescu/nova-33 | 6d3cf9010a45edb16f28b2582eafe35666381d1f | [
"Apache-2.0"
] | 2 | 2019-12-23T18:06:28.000Z | 2020-07-24T08:44:28.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | 46.132948 | 79 | 0.500439 |
bd5788b354d3eb5c167f80b1f9f9cb48f67db2dd | 659 | py | Python | tests/test_utils.py | scottwernervt/clipmanager | 34e9f45f7d9a3cef423d9d54df5d220aed5fd821 | [
"BSD-4-Clause"
] | 12 | 2016-02-11T04:14:35.000Z | 2021-12-16T08:13:05.000Z | tests/test_utils.py | scottwernervt/clipmanager | 34e9f45f7d9a3cef423d9d54df5d220aed5fd821 | [
"BSD-4-Clause"
] | 11 | 2018-02-01T21:20:08.000Z | 2018-07-20T16:02:01.000Z | tests/test_utils.py | scottwernervt/clipmanager | 34e9f45f7d9a3cef423d9d54df5d220aed5fd821 | [
"BSD-4-Clause"
] | null | null | null | import pytest
from clipmanager.utils import format_title, truncate_lines
@pytest.mark.parametrize('title,expected', [
('plain-text', 'plain-text'),
('\tplain-text', 'plain-text'),
('\nplain-text', '\nplain-text'),
])
def test_format_title(title, expected):
assert format_title(title) == expected
@py... | 28.652174 | 67 | 0.664643 |
c4dc96d9535743df8cab7b37cf2efd61d069b39b | 3,173 | py | Python | reviewboard/diffviewer/tests/test_filediff_creator.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 921 | 2015-01-01T15:26:28.000Z | 2022-03-29T11:30:38.000Z | reviewboard/diffviewer/tests/test_filediff_creator.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 5 | 2015-03-17T18:57:47.000Z | 2020-10-02T13:24:31.000Z | reviewboard/diffviewer/tests/test_filediff_creator.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 285 | 2015-01-12T06:24:36.000Z | 2022-03-29T11:03:50.000Z | """Tests for reviewboard.diffviewer.filediff_creator."""
from __future__ import unicode_literals
from django.utils.timezone import now
from reviewboard.diffviewer.filediff_creator import create_filediffs
from reviewboard.diffviewer.models import DiffCommit, DiffSet
from reviewboard.testing import TestCase
class Fi... | 33.052083 | 72 | 0.598487 |
da424516a3de89a7a79f9e9c375fa4548d3ac2ee | 1,255 | py | Python | pinax/stripe/management/commands/sync_customers.py | ticosax/pinax-stripe | 8321d0762592e1d32474ec7ee4bd1eb7451489e4 | [
"MIT"
] | null | null | null | pinax/stripe/management/commands/sync_customers.py | ticosax/pinax-stripe | 8321d0762592e1d32474ec7ee4bd1eb7451489e4 | [
"MIT"
] | 1 | 2017-10-25T16:50:01.000Z | 2017-10-25T16:54:46.000Z | pinax/stripe/management/commands/sync_customers.py | ticosax/pinax-stripe | 8321d0762592e1d32474ec7ee4bd1eb7451489e4 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from stripe.error import InvalidRequestError
from ...actions import charges, customers, invoices
class Command(BaseCommand):
help = "Sync customer data"
def handle(self, *args, **options):
User = get... | 34.861111 | 75 | 0.596813 |
08894fb49425cb5f0ae070f72dfed9f8af19a9e1 | 4,886 | py | Python | src/pygaps/modelling/da.py | pauliacomi/pyGAPS | c4d45b710e171c937471686437e382e05aec4ed5 | [
"MIT"
] | 35 | 2018-01-24T14:59:08.000Z | 2022-03-10T02:47:58.000Z | src/pygaps/modelling/da.py | pauliacomi/pyGAPS | c4d45b710e171c937471686437e382e05aec4ed5 | [
"MIT"
] | 29 | 2018-01-06T12:08:08.000Z | 2022-03-11T20:26:53.000Z | src/pygaps/modelling/da.py | pauliacomi/pyGAPS | c4d45b710e171c937471686437e382e05aec4ed5 | [
"MIT"
] | 20 | 2019-06-12T19:20:29.000Z | 2022-03-02T09:57:02.000Z | """Dubinin-Astakov isotherm model."""
import numpy
from .. import scipy
from .base_model import IsothermBaseModel
class DA(IsothermBaseModel):
r"""
Dubinin-Astakov (DA) adsorption isotherm.
.. math::
n(p) = n_t \exp\Big[-\Big(\frac{-RT\ln(p/p_0)}{\varepsilon}\Big)^{m}\Big]
The pressure pa... | 29.257485 | 99 | 0.580639 |
04a8eabec9755d2756f59f68d9c9cdd34e8f9e69 | 6,340 | py | Python | aioruuvitag/ruuvitag_df3.py | hulttis/ruuvigw | 914eb657e3f2792cecf6848dfa7607ad45f17ab4 | [
"MIT"
] | 7 | 2019-11-08T07:30:05.000Z | 2022-02-20T21:58:44.000Z | aioruuvitag/ruuvitag_df3.py | hulttis/ruuvigw | 914eb657e3f2792cecf6848dfa7607ad45f17ab4 | [
"MIT"
] | null | null | null | aioruuvitag/ruuvitag_df3.py | hulttis/ruuvigw | 914eb657e3f2792cecf6848dfa7607ad45f17ab4 | [
"MIT"
] | 1 | 2021-06-19T16:52:55.000Z | 2021-06-19T16:52:55.000Z | # coding=utf-8
# !/usr/bin/python3
# Name: ruuvitag df3 - formating dataformat 3
# Copyright: (c) 2019 TK
# Licence: MIT
# data format: https://github.com/ruuvi/ruuvi-sensor-protocols
# -------------------------------------------------------------------------------
import logging
logger = logging.getLo... | 44.335664 | 161 | 0.519716 |
5896ac9775da6c8fc181eec0dd3aa93bbe286ba1 | 337 | py | Python | batchout/selectors/base.py | ilia-khaustov/batchout | e916a1b0bfac771e6c96d0ff2478dc3f44804a94 | [
"MIT"
] | 8 | 2019-11-05T06:54:30.000Z | 2021-12-14T14:52:24.000Z | batchout/selectors/base.py | ilia-khaustov/batchout | e916a1b0bfac771e6c96d0ff2478dc3f44804a94 | [
"MIT"
] | null | null | null | batchout/selectors/base.py | ilia-khaustov/batchout | e916a1b0bfac771e6c96d0ff2478dc3f44804a94 | [
"MIT"
] | 1 | 2020-05-05T09:31:14.000Z | 2020-05-05T09:31:14.000Z | import abc
from typing import Any, Generator, List
from batchout.core.data import Data
class Selector(object):
@abc.abstractmethod
def columns(self) -> List[Any]:
raise NotImplementedError
@abc.abstractmethod
def apply(self, data: Data) -> Generator[List[Any], None, None]:
raise Not... | 21.0625 | 68 | 0.703264 |
0330008e7abe95fc7cb78a938482fb818d30e1b6 | 574 | py | Python | metaspace/off-sample/app.py | METASPACE2020/METASPACE | e1acd9a409f84a78eed7ca9713258c09b0e137ca | [
"Apache-2.0"
] | 32 | 2018-08-13T15:49:42.000Z | 2022-01-17T18:32:19.000Z | metaspace/off-sample/app.py | METASPACE2020/METASPACE | e1acd9a409f84a78eed7ca9713258c09b0e137ca | [
"Apache-2.0"
] | 624 | 2018-07-02T15:18:22.000Z | 2022-03-30T08:10:35.000Z | metaspace/off-sample/app.py | METASPACE2020/METASPACE | e1acd9a409f84a78eed7ca9713258c09b0e137ca | [
"Apache-2.0"
] | 6 | 2021-01-10T22:24:30.000Z | 2022-03-16T19:14:37.000Z | import falcon
from off_sample.resources import PingResource, PredictResource
from off_sample.utils import logger
def create_app():
api = falcon.API()
api.add_route('/off-sample', PingResource())
api.add_route('/off-sample/predict', PredictResource())
return api
def get_app():
return create_app(... | 22.076923 | 62 | 0.696864 |
412f28da313de50acca2380db41f13a768fe55dc | 4,405 | py | Python | build/images/convert_system_package_info_to_system_rsp.py | csrpi/fuchsia | 2f015594dcb4c13aa51eee305ad561078f1f9b7f | [
"BSD-2-Clause"
] | null | null | null | build/images/convert_system_package_info_to_system_rsp.py | csrpi/fuchsia | 2f015594dcb4c13aa51eee305ad561078f1f9b7f | [
"BSD-2-Clause"
] | null | null | null | build/images/convert_system_package_info_to_system_rsp.py | csrpi/fuchsia | 2f015594dcb4c13aa51eee305ad561078f1f9b7f | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3.8
# Copyright 2021 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Converts a .json file listing fini manifests into a .system.rsp file.'''
import argparse
import collections
import json
import sys... | 40.045455 | 118 | 0.635187 |
cf6ab0d56fe8f48ac63921134b0772b2956c005c | 7,477 | py | Python | Bio/AlignIO/NexusIO.py | adamnovak/biopython | 92772dd6add33e0b87ab593841f924f0f6f16090 | [
"PostgreSQL"
] | 5 | 2016-03-09T03:41:23.000Z | 2022-01-24T12:34:44.000Z | Bio/AlignIO/NexusIO.py | phillord/biopython | c8dfe46f192d6ccfac94b156cef024776545638e | [
"PostgreSQL"
] | null | null | null | Bio/AlignIO/NexusIO.py | phillord/biopython | c8dfe46f192d6ccfac94b156cef024776545638e | [
"PostgreSQL"
] | 6 | 2016-10-24T11:27:13.000Z | 2020-02-26T16:35:01.000Z | # Copyright 2008-2010 by Peter Cock. All rights reserved.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Bio.AlignIO support for the "nexus" file format.
You are expected to use this module vi... | 35.268868 | 81 | 0.642771 |
6f9b89cf2eaa68ee764a6a56f81b24bcf5b69a8d | 381 | py | Python | helper/WriteAJson.py | VyniMarques/S202-mongo-aggregate | 22e72b806a1eadbb05a2c86b8166541ad0c7f35c | [
"MIT"
] | null | null | null | helper/WriteAJson.py | VyniMarques/S202-mongo-aggregate | 22e72b806a1eadbb05a2c86b8166541ad0c7f35c | [
"MIT"
] | null | null | null | helper/WriteAJson.py | VyniMarques/S202-mongo-aggregate | 22e72b806a1eadbb05a2c86b8166541ad0c7f35c | [
"MIT"
] | null | null | null |
import json
import os
from bson import json_util
def writeAJson(data, name: str):
parsed_json = json.loads(json_util.dumps(data))
if not os.path.isdir("./json"):
os.makedirs("./json")
with open(f"./json/{name}.json", 'w') as json_file:
json.dump(parsed_json, json_file,
... | 22.411765 | 55 | 0.564304 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.