hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17f30e877c2aae56a206b2ffd565e6dc2380d1a3 | 3,010 | py | Python | load_blender.py | wyf2020/nerf-pytorch | f05988e2ebef10f9de96aec8e3c23ae2563000db | [
"MIT"
] | null | null | null | load_blender.py | wyf2020/nerf-pytorch | f05988e2ebef10f9de96aec8e3c23ae2563000db | [
"MIT"
] | null | null | null | load_blender.py | wyf2020/nerf-pytorch | f05988e2ebef10f9de96aec8e3c23ae2563000db | [
"MIT"
] | null | null | null | import os
import torch
import numpy as np
import imageio
import json
import torch.nn.functional as F
import cv2
trans_t = lambda t : torch.Tensor([ # z轴平移t
[1,0,0,0],
[0,1,0,0],
[0,0,1,t],
[0,0,0,1]]).float()
rot_phi = lambda phi : torch.Tensor([ # 将yz轴(面向x轴)逆时针旋转phi度
[1,0,0,0],
[0,np.cos(ph... | 31.684211 | 134 | 0.592027 |
ab73ccd427192972683025509afdae49982039d6 | 2,903 | py | Python | ProxyManager.py | Liuuux2/LPBots | e595c6126e3a851f28e53e3bfc27de4a94a15bd7 | [
"MIT"
] | 2 | 2022-02-20T18:16:09.000Z | 2022-02-28T04:29:54.000Z | ProxyManager.py | Liuuux2/LPBots | e595c6126e3a851f28e53e3bfc27de4a94a15bd7 | [
"MIT"
] | null | null | null | ProxyManager.py | Liuuux2/LPBots | e595c6126e3a851f28e53e3bfc27de4a94a15bd7 | [
"MIT"
] | 2 | 2021-09-06T13:30:52.000Z | 2022-02-20T18:16:10.000Z | from threading import Lock
import time
if 100 - 100: Oo / Ii * oO0OOoOOO0OO0
class PM_ :
if 31 - 31: o000 + iIiIi1i1II11 . I111Iiii11 . iiII1i1i1I1iI - iiI
def __init__ ( self ) :
self . timestamps = dict ( )
self . proxies = open ( 'proxies.txt' ) . re... | 58.06 | 125 | 0.336893 |
38eb3c193351d86d7e1caadf2932108f1ebcba4f | 2,512 | py | Python | Scripts/Miscellaneous/Bulk Certificate Generator and emailer/main.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 437 | 2020-09-24T13:57:39.000Z | 2022-03-30T12:45:56.000Z | Scripts/Miscellaneous/Bulk Certificate Generator and emailer/main.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 355 | 2020-09-24T13:53:16.000Z | 2022-03-27T04:20:40.000Z | Scripts/Miscellaneous/Bulk Certificate Generator and emailer/main.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 315 | 2020-09-24T18:41:19.000Z | 2022-03-07T05:53:01.000Z | import pandas as pd
from PIL import Image, ImageDraw, ImageFont
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
import email.message as em
import getpass
import re
def mail(df, from_, password):
... | 24.871287 | 84 | 0.580016 |
c7c5015d833f3fa4b3aa634f8afaf9e6a1348d98 | 6,781 | py | Python | podaac/subsetter/xarray_enhancements.py | fgreg/l2ss-py | 1ac790392a1895b9ad532b60a37c144a0326f1cc | [
"Apache-2.0"
] | null | null | null | podaac/subsetter/xarray_enhancements.py | fgreg/l2ss-py | 1ac790392a1895b9ad532b60a37c144a0326f1cc | [
"Apache-2.0"
] | null | null | null | podaac/subsetter/xarray_enhancements.py | fgreg/l2ss-py | 1ac790392a1895b9ad532b60a37c144a0326f1cc | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, by the California Institute of Technology.
# ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.
# Any commercial use must be negotiated with the Office of Technology
# Transfer at the California Institute of Technology.
#
# This software may be subject to U.S. export control laws.... | 31.248848 | 95 | 0.630143 |
03e8536ce0f448cdc3bc602c9be84b4cbcf43eea | 455 | py | Python | data/scripts/templates/object/building/player/city/shared_garden_naboo_sml_01.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/building/player/city/shared_garden_naboo_sml_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/building/player/city/shared_garden_naboo_sml_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/player/city/shared_garden_naboo_sml_01.iff"
result.attribute_templa... | 26.764706 | 79 | 0.72967 |
bd49c92c50d0622c240faf400ef635b98be995f5 | 8,788 | py | Python | fire/cli/niv/_netoversigt.py | xidus/FIRE | 9508b26faff4830b70981c21d3fdc33c20c85dde | [
"MIT"
] | 1 | 2018-12-15T16:13:09.000Z | 2018-12-15T16:13:09.000Z | fire/cli/niv/_netoversigt.py | xidus/FIRE | 9508b26faff4830b70981c21d3fdc33c20c85dde | [
"MIT"
] | 49 | 2018-11-13T23:04:09.000Z | 2019-10-31T11:15:13.000Z | fire/cli/niv/_netoversigt.py | xidus/FIRE | 9508b26faff4830b70981c21d3fdc33c20c85dde | [
"MIT"
] | 3 | 2018-11-15T14:06:36.000Z | 2019-01-07T13:30:29.000Z | import sys
from collections import Counter
from typing import Dict, List, Set, Tuple
import click
import pandas as pd
from fire.io.regneark import arkdef
import fire.cli
from . import (
find_faneblad,
niv,
skriv_ark,
er_projekt_okay,
)
@niv.command()
@fire.cli.default_options()
@click.argument(
... | 34.598425 | 121 | 0.615498 |
3adb1cecee29c6bbbd5c83ab568d98eda46cab8c | 801 | py | Python | .history/postImages/index_20201006193849.py | Lambda-School-Labs/Labs27-C-Bridges-To-Prosperity-BE | 9a8289d8550115362c46dea3ed8570b789c09a10 | [
"MIT"
] | 2 | 2020-10-21T22:14:15.000Z | 2020-10-21T22:14:16.000Z | .history/postImages/index_20201006193849.py | Lambda-School-Labs/Labs27-C-Bridges-To-Prosperity-BE | 9a8289d8550115362c46dea3ed8570b789c09a10 | [
"MIT"
] | null | null | null | .history/postImages/index_20201006193849.py | Lambda-School-Labs/Labs27-C-Bridges-To-Prosperity-BE | 9a8289d8550115362c46dea3ed8570b789c09a10 | [
"MIT"
] | null | null | null | import csv
import requests
df = open("bridgeData3.csv",'r').readlines()
fin = open('final.csv','r').readlines()
finCsv = fin[1:]
# url = https://b2ptc.herokuapp.com/bridges
finalCsv = df[1:]
obj = {}
for i in finalCsv:
x = i.split(',')
obj[x[1]] = {'bridge_name':x[0],'proj_code':x[1],'before_img':x[2],'after_im... | 28.607143 | 97 | 0.593009 |
659d6b4288584bb21d11408cf8f954cf3729a603 | 940 | py | Python | celescope/mut/mapping_mut.py | susucy/CeleScope | a5d9501ff8bd9dc067b9718070876acb0767a6cf | [
"MIT"
] | null | null | null | celescope/mut/mapping_mut.py | susucy/CeleScope | a5d9501ff8bd9dc067b9718070876acb0767a6cf | [
"MIT"
] | null | null | null | celescope/mut/mapping_mut.py | susucy/CeleScope | a5d9501ff8bd9dc067b9718070876acb0767a6cf | [
"MIT"
] | null | null | null | import os
from celescope.tools.utils import format_number, log, STAR_util
@log
def mapping_mut(args):
STAR_util(
args.sample,
args.outdir,
args.fq,
args.indel_genomeDir,
args.thread,
args.outFilterMatchNmin,
outBAMsortingBinsN=200,
)
def get_opts_mappi... | 32.413793 | 91 | 0.669149 |
69f8b3c0ae792e0f1c03dff538a9fa38ae4fc7e6 | 1,269 | py | Python | aries_cloudagent/protocols/trustping/v1_0/handlers/ping_response_handler.py | msembinelli/aries-cloudagent-python | a5a29dab30238f52dcfb6645aab115d01720a5c7 | [
"Apache-2.0"
] | 1 | 2021-01-15T01:04:43.000Z | 2021-01-15T01:04:43.000Z | aries_cloudagent/protocols/trustping/v1_0/handlers/ping_response_handler.py | msembinelli/aries-cloudagent-python | a5a29dab30238f52dcfb6645aab115d01720a5c7 | [
"Apache-2.0"
] | 22 | 2021-02-13T18:48:53.000Z | 2021-04-27T07:29:50.000Z | aries_cloudagent/protocols/trustping/v1_0/handlers/ping_response_handler.py | msembinelli/aries-cloudagent-python | a5a29dab30238f52dcfb6645aab115d01720a5c7 | [
"Apache-2.0"
] | 3 | 2020-07-03T21:35:34.000Z | 2020-09-09T13:26:20.000Z | """Ping response handler."""
from .....messaging.base_handler import (
BaseHandler,
BaseResponder,
RequestContext,
)
from ..messages.ping_response import PingResponse
class PingResponseHandler(BaseHandler):
"""Ping response handler class."""
async def handle(self, context: RequestContext, respo... | 28.840909 | 87 | 0.602837 |
091c3f396708ddde1ef5d9fc6143c64e9693322a | 1,580 | py | Python | sentinelone/komand_sentinelone/actions/activities_types/schema.py | emartin-merrill-r7/insightconnect-plugins | a589745dbcc9f01d3e601431e77ab7221a84c117 | [
"MIT"
] | 1 | 2020-03-18T09:14:55.000Z | 2020-03-18T09:14:55.000Z | sentinelone/komand_sentinelone/actions/activities_types/schema.py | OSSSP/insightconnect-plugins | 846758dab745170cf1a8c146211a8bea9592e8ff | [
"MIT"
] | 1 | 2021-02-23T23:57:37.000Z | 2021-02-23T23:57:37.000Z | sentinelone/komand_sentinelone/actions/activities_types/schema.py | OSSSP/insightconnect-plugins | 846758dab745170cf1a8c146211a8bea9592e8ff | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Get a list of activity types"
class Input:
pass
class Output:
ACTIVITY_TYPES = "activity_types"
class ActivitiesTypesInput(komand.Input):
schema = json.loads("""
{}
""")
def __init__(... | 20.789474 | 82 | 0.537975 |
4833cdbd792b8a1ee9da55f5d1874a6671bddbd6 | 2,537 | py | Python | tic_tac_toe/board.py | Nimor111/pazaak-python | 0a3e39230c401e7d9f9d030b2279e583d70f3340 | [
"Apache-2.0"
] | 1 | 2021-09-18T05:50:46.000Z | 2021-09-18T05:50:46.000Z | tic_tac_toe/board.py | Nimor111/pazaak-python | 0a3e39230c401e7d9f9d030b2279e583d70f3340 | [
"Apache-2.0"
] | 3 | 2021-10-05T23:24:53.000Z | 2022-02-18T03:19:56.000Z | tic_tac_toe/board.py | Nimor111/pazaak-python | 0a3e39230c401e7d9f9d030b2279e583d70f3340 | [
"Apache-2.0"
] | 2 | 2019-07-08T08:36:22.000Z | 2021-09-18T05:50:48.000Z | from copy import deepcopy
from dataclasses import dataclass
from tic_tac_toe.player import TicTacPlayer
import core.constants as constants
from core.board import Board, Position
@dataclass
class TicTacBoard(Board):
def move_new(self, position: Position, player: TicTacPlayer):
new_board = deepcopy(self.... | 35.732394 | 115 | 0.587308 |
8c56688acb06df5fb96596111909bcd08a41a7d0 | 2,232 | py | Python | Assignment1/frequency.py | rucka/coursera-introduction-to-data-science | f6922be5dd7cd045b4815c8ba9d86354a537ca5a | [
"Apache-2.0"
] | null | null | null | Assignment1/frequency.py | rucka/coursera-introduction-to-data-science | f6922be5dd7cd045b4815c8ba9d86354a537ca5a | [
"Apache-2.0"
] | null | null | null | Assignment1/frequency.py | rucka/coursera-introduction-to-data-science | f6922be5dd7cd045b4815c8ba9d86354a537ca5a | [
"Apache-2.0"
] | null | null | null | import re
import functools
import itertools
import json
import sys
def lines(fp):
print str(len(fp.readlines()))
def prints(items):
for i in items:
print i
def print_frequencies(frequencies):
for i in frequencies.keys():
print ("%s %.6f" %(i, frequencies[i]))
def main():
words = extr... | 26.571429 | 115 | 0.584677 |
44f31dc1aea0790fdc71e43e6b14d23d108ba568 | 907 | py | Python | src/wheel_inspect/__init__.py | pombredanne/wheel-inspect | 0d0d861574e3fca57c6d4a00573e46dec600ae42 | [
"MIT"
] | null | null | null | src/wheel_inspect/__init__.py | pombredanne/wheel-inspect | 0d0d861574e3fca57c6d4a00573e46dec600ae42 | [
"MIT"
] | null | null | null | src/wheel_inspect/__init__.py | pombredanne/wheel-inspect | 0d0d861574e3fca57c6d4a00573e46dec600ae42 | [
"MIT"
] | null | null | null | """
Extract information from wheels
``wheel-inspect`` examines Python wheel files and outputs various information
about the contents within as JSON-serializable objects. It can be invoked in
Python code as::
from wheel_inspect import inspect_wheel
output = inspect_wheel(path_to_wheel_file)
or from the comm... | 26.676471 | 77 | 0.735391 |
d846836108ce19cd91eb7ea91f73d9564b4cee43 | 1,630 | py | Python | Chapter34.ExceptionCodingDetails/6-withas.py | mindnhand/Learning-Python-5th | 3dc1b28d6e048d512bf851de6c7f6445edfe7b84 | [
"MIT"
] | null | null | null | Chapter34.ExceptionCodingDetails/6-withas.py | mindnhand/Learning-Python-5th | 3dc1b28d6e048d512bf851de6c7f6445edfe7b84 | [
"MIT"
] | null | null | null | Chapter34.ExceptionCodingDetails/6-withas.py | mindnhand/Learning-Python-5th | 3dc1b28d6e048d512bf851de6c7f6445edfe7b84 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#encoding=utf-8
#---------------------------------------------
# Usage: python3 6-withas.py
# Description: defines a context manager object that traces the entry and
# exit of the with block in any with statement it is used for
#---------------------------------------------
cla... | 27.627119 | 83 | 0.590798 |
1bb44489b1762c8c8141d8a1e8aee915d383ec20 | 12,904 | py | Python | code/python/QuotesAPIforDigitalPortals/v3/fds/sdk/QuotesAPIforDigitalPortals/model/inline_response20062_data_general_guarantor.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/QuotesAPIforDigitalPortals/v3/fds/sdk/QuotesAPIforDigitalPortals/model/inline_response20062_data_general_guarantor.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/QuotesAPIforDigitalPortals/v3/fds/sdk/QuotesAPIforDigitalPortals/model/inline_response20062_data_general_guarantor.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
Quotes API For Digital Portals
The quotes API combines endpoints for retrieving security end-of-day, delayed, and realtime prices with performance key figures and basic reference data on the security and market level. The API supports over 20 different price types for each quote and comes with basic searc... | 48.878788 | 1,302 | 0.595009 |
2337b98af6a5aee4c3d435a229c37af4bf865bdd | 20,530 | py | Python | consoleme/models.py | init-8/consoleme | 047dd5e28e3545f8ad7872eaf91307e283952dc4 | [
"Apache-2.0"
] | null | null | null | consoleme/models.py | init-8/consoleme | 047dd5e28e3545f8ad7872eaf91307e283952dc4 | [
"Apache-2.0"
] | null | null | null | consoleme/models.py | init-8/consoleme | 047dd5e28e3545f8ad7872eaf91307e283952dc4 | [
"Apache-2.0"
] | null | null | null | # generated by datamodel-codegen:
# filename: swagger.yaml
# timestamp: 2021-04-29T21:14:25+00:00
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional, Union
from pydantic import Field, constr
from consoleme.lib.pydantic import Base... | 30.058565 | 292 | 0.677496 |
9ffaa52f1b1f1ad63ea1ae447b7e5a27238eadd4 | 1,306 | py | Python | chainer/functions/array/cast.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | chainer/functions/array/cast.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | chainer/functions/array/cast.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | from chainer import function
from chainer.utils import type_check
class Cast(function.Function):
"""Cast function."""
def __init__(self, typ):
self.type = typ
def check_type_forward(self, in_types):
type_check.expect(in_types.size() == 1)
x_type = in_types[0]
type_check... | 24.641509 | 68 | 0.562021 |
a2b49db29c94e2c608be207288526f5a37765b90 | 376 | py | Python | uqcsbot/scripts/radar.py | mitchmcdee/uqcsbot | a6c39d59b6fd99b94428d67e4a26330423b4240c | [
"MIT"
] | null | null | null | uqcsbot/scripts/radar.py | mitchmcdee/uqcsbot | a6c39d59b6fd99b94428d67e4a26330423b4240c | [
"MIT"
] | null | null | null | uqcsbot/scripts/radar.py | mitchmcdee/uqcsbot | a6c39d59b6fd99b94428d67e4a26330423b4240c | [
"MIT"
] | null | null | null | from uqcsbot import bot, Command
from time import time
@bot.on_command("radar")
def handle_radar(command: Command):
'''
`!radar` - Returns the latest BOM radar image for Brisbane.
'''
time_in_ms = int(round(time() * 1000))
radar_url = f'https://bom.lambda.tools/?location=brisbane&_cache={time_in_m... | 28.923077 | 82 | 0.704787 |
30d94afa6d7d2f51cd26f71c9d5692f0f51bf5d9 | 27,836 | py | Python | conda/core/subdir_data.py | brettcannon/conda | baee708120b88682a799dc54ca2f978836f8464e | [
"BSD-3-Clause"
] | null | null | null | conda/core/subdir_data.py | brettcannon/conda | baee708120b88682a799dc54ca2f978836f8464e | [
"BSD-3-Clause"
] | null | null | null | conda/core/subdir_data.py | brettcannon/conda | baee708120b88682a799dc54ca2f978836f8464e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
import bz2
from collections import defaultdict
from contextlib import closing
from errno import EACCES, ENODEV, EPERM, EROFS
from functoo... | 42.048338 | 99 | 0.606589 |
2c730741676288cbd767a0df45d32b0b4e2262a4 | 11,429 | py | Python | src/sentry/http.py | JannKleen/sentry | 8b29c8234bb51a81d5cab821a1f2ed4ea8e8bd88 | [
"BSD-3-Clause"
] | 1 | 2019-02-27T15:13:06.000Z | 2019-02-27T15:13:06.000Z | src/sentry/http.py | rmax/sentry | 8b29c8234bb51a81d5cab821a1f2ed4ea8e8bd88 | [
"BSD-3-Clause"
] | 5 | 2020-07-17T11:20:41.000Z | 2021-05-09T12:16:53.000Z | src/sentry/http.py | zaasmi/codeerrorhelp | 1ab8d3e314386b9b2d58dad9df45355bf6014ac9 | [
"BSD-3-Clause"
] | 2 | 2021-01-26T09:53:39.000Z | 2022-03-22T09:01:47.000Z | """
sentry.utils.http
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import sentry
import ipaddress
import six
import socket
import requests
import warnings
import time
import loggin... | 30.155673 | 96 | 0.604252 |
df54293cbd0f4972c7ebfe3ec01dade3270af511 | 999 | bzl | Python | third_party/protobuf/cc_proto_blacklist_test.bzl | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | third_party/protobuf/cc_proto_blacklist_test.bzl | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 339 | 2020-10-30T14:59:42.000Z | 2022-03-31T23:48:16.000Z | third_party/protobuf/cc_proto_blacklist_test.bzl | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | """Contains a unittest to verify that `cc_proto_library` does not generate code for blacklisted `.proto` sources (i.e. WKPs)."""
load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest")
def _cc_proto_blacklist_test_impl(ctx):
"""Verifies that there are no C++ compile actions for Well-Known-Protos.
Args... | 25.615385 | 128 | 0.57958 |
28f342ec628650ed44f444923601d31df71636a1 | 9,999 | py | Python | contrib/spendfrom/spendfrom.py | afghany/castletmp | 9d0daed2a6abaf7d93f9308f5c602db6eeb42c8b | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | afghany/castletmp | 9d0daed2a6abaf7d93f9308f5c602db6eeb42c8b | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | afghany/castletmp | 9d0daed2a6abaf7d93f9308f5c602db6eeb42c8b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Use the raw transactions API to spend CSTLs received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a castled or castle-... | 37.309701 | 111 | 0.631263 |
620d3f5deaf179279b887af65fed412a1a21ae60 | 10,321 | py | Python | testscripts/RDKB/component/XCONF/TS_XCONF_ExceedMaxImageNameSize.py | cablelabs/tools-tdkb | 1fd5af0f6b23ce6614a4cfcbbaec4dde430fad69 | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/XCONF/TS_XCONF_ExceedMaxImageNameSize.py | cablelabs/tools-tdkb | 1fd5af0f6b23ce6614a4cfcbbaec4dde430fad69 | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/XCONF/TS_XCONF_ExceedMaxImageNameSize.py | cablelabs/tools-tdkb | 1fd5af0f6b23ce6614a4cfcbbaec4dde430fad69 | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2016 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 43.919149 | 364 | 0.675807 |
c9e46d1c04ce6e70e7ffc17c021d03ab9fd7009f | 210,714 | py | Python | infoblox_netmri/api/broker/v3_8_0/infra_device_broker.py | infobloxopen/infoblox_netmri | aa1c744df7e439dbe163bb9edd165e4e85a9771b | [
"Apache-2.0"
] | 12 | 2016-02-19T12:37:54.000Z | 2022-03-04T20:11:08.000Z | infoblox_netmri/api/broker/v3_8_0/infra_device_broker.py | infobloxopen/infoblox_netmri | aa1c744df7e439dbe163bb9edd165e4e85a9771b | [
"Apache-2.0"
] | 18 | 2015-11-12T18:37:00.000Z | 2021-05-19T07:59:55.000Z | infoblox_netmri/api/broker/v3_8_0/infra_device_broker.py | infobloxopen/infoblox_netmri | aa1c744df7e439dbe163bb9edd165e4e85a9771b | [
"Apache-2.0"
] | 18 | 2016-01-07T12:04:34.000Z | 2022-03-31T11:05:41.000Z | from ..broker import Broker
class InfraDeviceBroker(Broker):
controller = "infra_devices"
def index(self, **kwargs):
"""Lists the available infra devices. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method is... | 53.685096 | 1,192 | 0.628829 |
07b59b14212f1b9359357996f1e2bcc21ac78ad2 | 5,932 | py | Python | ml-agents/mlagents/trainers/tests/test_bc.py | arghyasur1991/ml-agents | 85db9066aadad95049c5f05c7113225ca3393ea3 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/tests/test_bc.py | arghyasur1991/ml-agents | 85db9066aadad95049c5f05c7113225ca3393ea3 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/tests/test_bc.py | arghyasur1991/ml-agents | 85db9066aadad95049c5f05c7113225ca3393ea3 | [
"Apache-2.0"
] | null | null | null | import unittest.mock as mock
import pytest
import numpy as np
import tensorflow.compat.v1 as tf
import yaml
from mlagents.trainers.bc.models import BehavioralCloningModel
from mlagents.trainers.bc.policy import BCPolicy
from mlagents.envs import UnityEnvironment
from mlagents.envs.mock_communicator import MockCommuni... | 40.630137 | 83 | 0.605361 |
20cae899b4a37d7669bd28e21998f851aaad0593 | 48,882 | py | Python | python/ccxt/probit.py | adazer/ccxt | 8de7e456ade96a4ee45184e2a9bb36842a5c98ae | [
"MIT"
] | null | null | null | python/ccxt/probit.py | adazer/ccxt | 8de7e456ade96a4ee45184e2a9bb36842a5c98ae | [
"MIT"
] | null | null | null | python/ccxt/probit.py | adazer/ccxt | 8de7e456ade96a4ee45184e2a9bb36842a5c98ae | [
"MIT"
] | null | null | null | # -*- 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
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... | 41.35533 | 512 | 0.486478 |
ed54b844ecff97bb52e5afca89fc9603731dc5d4 | 20,950 | py | Python | scripts/generateDataFiles.py | umutbalkan/aoe2techtree | eff711adfc004d3ca897e3d1e35fe8a9b0b93604 | [
"MIT"
] | null | null | null | scripts/generateDataFiles.py | umutbalkan/aoe2techtree | eff711adfc004d3ca897e3d1e35fe8a9b0b93604 | [
"MIT"
] | null | null | null | scripts/generateDataFiles.py | umutbalkan/aoe2techtree | eff711adfc004d3ca897e3d1e35fe8a9b0b93604 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import argparse
import json
import re
from pathlib import Path
CIV_NAMES = {
"Britons": "10271",
"Franks": "10272",
"Goths": "10273",
"Teutons": "10274",
"Japanese": "10275",
"Chinese": "10276",
"Byzantines": "10277",
"Persians": "10278",
"Saracens": "10279"... | 35.568761 | 112 | 0.58716 |
faf4df49dc55c884c3dc4ce102af75b968188197 | 10,047 | py | Python | tests/integration_tests/test_hyperopt.py | Yard1/ludwig | 510455f8d4fcd6b66e76d2c906d2c600fe724093 | [
"Apache-2.0"
] | 1 | 2021-06-26T07:52:12.000Z | 2021-06-26T07:52:12.000Z | tests/integration_tests/test_hyperopt.py | Yard1/ludwig | 510455f8d4fcd6b66e76d2c906d2c600fe724093 | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/test_hyperopt.py | Yard1/ludwig | 510455f8d4fcd6b66e76d2c906d2c600fe724093 | [
"Apache-2.0"
] | 1 | 2019-09-05T09:19:39.000Z | 2019-09-05T09:19:39.000Z | # -*- coding: utf-8 -*-
# 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 obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 32.409677 | 80 | 0.569822 |
4dcb8d55c84c3b67275f82a2d76ea6b973a47528 | 21,749 | py | Python | experiments/common.py | oeg-upm/tada-qq | ad8441093e21f4d598893cc2a263b128a7782e29 | [
"Apache-2.0"
] | 2 | 2022-01-26T08:48:34.000Z | 2022-01-26T08:48:37.000Z | experiments/common.py | oeg-upm/tada-qq | ad8441093e21f4d598893cc2a263b128a7782e29 | [
"Apache-2.0"
] | null | null | null | experiments/common.py | oeg-upm/tada-qq | ad8441093e21f4d598893cc2a263b128a7782e29 | [
"Apache-2.0"
] | null | null | null | import os
import logging
import numpy as np
import pandas as pd
from pandas.api.types import is_numeric_dtype
from easysparql import easysparqlclass
import seaborn as sns
import matplotlib.pyplot as plt
from pandas.api.types import CategoricalDtype
from pcake import pcake
from qq.qqe import QQE
from qq.dist import g... | 34.742812 | 152 | 0.562279 |
11d0c79fcb7f2ac708df9f3e7f4576325518e773 | 10,711 | py | Python | qiskit/circuit/library/n_local/qaoa_ansatz.py | MaxKelsen/qiskit-terra | 1ec2f5db5fea8df907cace3a0e0c92b6deac7fd3 | [
"Apache-2.0"
] | 1 | 2022-03-10T03:07:30.000Z | 2022-03-10T03:07:30.000Z | qiskit/circuit/library/n_local/qaoa_ansatz.py | MaxKelsen/qiskit-terra | 1ec2f5db5fea8df907cace3a0e0c92b6deac7fd3 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/n_local/qaoa_ansatz.py | MaxKelsen/qiskit-terra | 1ec2f5db5fea8df907cace3a0e0c92b6deac7fd3 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 37.714789 | 104 | 0.605452 |
d0e1ce4ee454d7f237a0f1e968f1878e897df563 | 16,506 | py | Python | Toolz/fimap/src/plugins/FindFirstFileAbuse/FindFirstFileAbuse.py | thezakman/CTF-Toolz | b369246ea6766165cce0852e537fb6a0c970869b | [
"Unlicense"
] | 71 | 2019-02-02T11:38:46.000Z | 2022-03-31T14:08:27.000Z | Exploitation/Web-Exploitation/PathTraversal/fimap/src/plugins/FindFirstFileAbuse/FindFirstFileAbuse.py | bhattsameer/TID3xploits | b57d8bae454081a3883a5684679e2a329e72d6e5 | [
"MIT"
] | null | null | null | Exploitation/Web-Exploitation/PathTraversal/fimap/src/plugins/FindFirstFileAbuse/FindFirstFileAbuse.py | bhattsameer/TID3xploits | b57d8bae454081a3883a5684679e2a329e72d6e5 | [
"MIT"
] | 15 | 2019-08-07T06:32:04.000Z | 2022-03-09T12:48:20.000Z | from plugininterface import basePlugin
# Plugin by Iman Karim <fimap.dev@gmail.com>
# License: GPLv2
import urlparse, socket, threading, base64, urllib, string, random, time
class FindFirstFileAbuse(basePlugin):
egg = "c:\\\\xampp\\\\tmp\\\\egg"
remotetmpdir = "c:\\xampp\\tmp"
maxAttempts = 5000
... | 50.477064 | 140 | 0.421544 |
41c567e0056b4b0a7327a1f8c7e684af1ebd42f3 | 6,845 | py | Python | tests/unit/objects/test_tree.py | daavoo/dvc | 04349a50eb638f3684e486cdf72bcb1c1e25613d | [
"Apache-2.0"
] | 1 | 2021-06-18T19:36:13.000Z | 2021-06-18T19:36:13.000Z | tests/unit/objects/test_tree.py | Indraji-Ushantha/dvc | cfcb7e12942d826c0c84c01966c0a47483b1d618 | [
"Apache-2.0"
] | 82 | 2021-05-04T02:40:05.000Z | 2022-03-31T03:14:04.000Z | tests/unit/objects/test_tree.py | Indraji-Ushantha/dvc | cfcb7e12942d826c0c84c01966c0a47483b1d618 | [
"Apache-2.0"
] | 2 | 2021-06-14T19:12:25.000Z | 2021-06-14T19:12:29.000Z | from operator import itemgetter
import pytest
from dvc.hash_info import HashInfo
from dvc.objects.file import HashFile
from dvc.objects.tree import Tree, _merge
@pytest.mark.parametrize(
"lst, trie_dict",
[
([], {}),
(
[
{"md5": "def", "relpath": "zzz"},
... | 31.543779 | 75 | 0.377064 |
0600aca92e29fe20adf6f004c74dd96504325826 | 16,238 | py | Python | pytorch_lightning/accelerators/accelerator.py | shreyalive/pytorch-lightning | 81b3acae6fe5ec018dc1228a904f573697447d1b | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/accelerator.py | shreyalive/pytorch-lightning | 81b3acae6fe5ec018dc1228a904f573697447d1b | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/accelerator.py | shreyalive/pytorch-lightning | 81b3acae6fe5ec018dc1228a904f573697447d1b | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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 i... | 38.940048 | 114 | 0.66874 |
76ffd9c7545298f2f9916ef923f26925bc5bb50f | 4,473 | py | Python | src/oci/data_catalog/models/property_definition.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/data_catalog/models/property_definition.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/data_catalog/models/property_definition.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 27.27439 | 245 | 0.616812 |
692c5c9f9fe0b22fa6afdafeb59291e8c3702cd6 | 53 | py | Python | test_scripts/explicit_relative_import/greetings/greeting.py | mwilliamson/stickytape | 054f432f5143b42542a0dfdb681d48d29e417a4a | [
"BSD-2-Clause"
] | 158 | 2015-11-17T09:35:25.000Z | 2022-03-24T09:21:42.000Z | test_scripts/explicit_relative_import/greetings/greeting.py | mwilliamson/stickytape | 054f432f5143b42542a0dfdb681d48d29e417a4a | [
"BSD-2-Clause"
] | 25 | 2017-08-29T21:31:36.000Z | 2021-06-14T19:31:35.000Z | test_scripts/explicit_relative_import/greetings/greeting.py | mwilliamson/stickytape | 054f432f5143b42542a0dfdb681d48d29e417a4a | [
"BSD-2-Clause"
] | 25 | 2017-12-29T00:11:27.000Z | 2022-03-20T22:15:22.000Z | from .messages import message
__all__ = ["message"]
| 13.25 | 29 | 0.735849 |
afc4d3ae630aa5e0e09455290aebc773e82f5944 | 2,135 | py | Python | tests/client/conftest.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | 832 | 2017-01-03T06:21:31.000Z | 2022-03-16T16:51:44.000Z | tests/client/conftest.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | 139 | 2017-02-16T16:02:48.000Z | 2022-02-10T14:05:41.000Z | tests/client/conftest.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | 116 | 2017-01-05T06:33:50.000Z | 2022-03-06T05:02:47.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import aredis
import asyncio
import pytest
import sys
from unittest.mock import Mock
from distutils.version import StrictVersion
_REDIS_VERSIONS = {}
async def get_version(**kwargs):
params = {'host': 'localhost', 'port': 6379, 'db': 0}
params.update(kwargs)
key... | 28.466667 | 88 | 0.697424 |
3faa4c6c17d97b0e43193f2331524b839585f5a8 | 318 | py | Python | lama_cleaner/tests/test_boxes_from_mask.py | gucs/lama-cleaner | 16c25acb9b9eec06d34d825beff1fc7fa0542ffb | [
"Apache-2.0"
] | null | null | null | lama_cleaner/tests/test_boxes_from_mask.py | gucs/lama-cleaner | 16c25acb9b9eec06d34d825beff1fc7fa0542ffb | [
"Apache-2.0"
] | null | null | null | lama_cleaner/tests/test_boxes_from_mask.py | gucs/lama-cleaner | 16c25acb9b9eec06d34d825beff1fc7fa0542ffb | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
from lama_cleaner.helper import boxes_from_mask
def test_boxes_from_mask():
mask = cv2.imread("mask.jpg", cv2.IMREAD_GRAYSCALE)
mask = mask[:, :, np.newaxis]
mask = (mask / 255).transpose(2, 0, 1)
boxes = boxes_from_mask(mask)
print(boxes)
test_boxes_from_mask()
| 19.875 | 55 | 0.701258 |
7ef9e81baec43ae7e03f99a46dd2dfb59c32e627 | 3,451 | py | Python | objectDetectors/objectDetectionInterface.py | ManuGar/objectDetectionAPI | 2cc72cd438e19ca494faa9955cb12e2540c499e6 | [
"MIT"
] | 7 | 2020-12-20T14:44:59.000Z | 2022-01-14T14:55:01.000Z | objectDetectors/objectDetectionInterface.py | ManuGar/objectDetectionAPI | 2cc72cd438e19ca494faa9955cb12e2540c499e6 | [
"MIT"
] | 47 | 2019-12-11T11:58:37.000Z | 2022-03-12T00:16:06.000Z | objectDetectors/objectDetectionInterface.py | ManuGar/UFOD | 2cc72cd438e19ca494faa9955cb12e2540c499e6 | [
"MIT"
] | null | null | null | import os
import shutil
from imutils import paths
from sklearn.model_selection import train_test_split
from distutils.dir_util import copy_tree
class IObjectDetection(object):
def __init__(self, dataset_path, dataset_name):
self.DATASET =dataset_path
self.DATASET_NAME =dataset_name
self.OUT... | 51.507463 | 119 | 0.689655 |
e84e366faa9381593b22c866a45f818a833b580b | 355 | py | Python | tests/test_examples.py | Jacob-harris-94/pulp | 6e16a360c59f22d35204d32332e7226c8f3b8230 | [
"MIT"
] | null | null | null | tests/test_examples.py | Jacob-harris-94/pulp | 6e16a360c59f22d35204d32332e7226c8f3b8230 | [
"MIT"
] | null | null | null | tests/test_examples.py | Jacob-harris-94/pulp | 6e16a360c59f22d35204d32332e7226c8f3b8230 | [
"MIT"
] | null | null | null | import os
import importlib
def test_examples(examples_dir='../examples'):
files = os.listdir(examples_dir)
for f_name in files:
if os.path.isdir(f_name):
continue
_f_name = 'examples.' + os.path.splitext(f_name)[0]
importlib.import_module(_f_name)
if __name__ == '__main__... | 23.666667 | 59 | 0.653521 |
dbc59867faf4d1415972d915a26f0e9ba258b70b | 2,728 | py | Python | carball/tests/analysis_test.py | Druthyn/carball | 924ba75d2a60d069a5722a3d2a98814765d79197 | [
"Apache-2.0"
] | null | null | null | carball/tests/analysis_test.py | Druthyn/carball | 924ba75d2a60d069a5722a3d2a98814765d79197 | [
"Apache-2.0"
] | null | null | null | carball/tests/analysis_test.py | Druthyn/carball | 924ba75d2a60d069a5722a3d2a98814765d79197 | [
"Apache-2.0"
] | null | null | null | import glob
import gzip
import os
import shutil
import subprocess
import traceback
from google.protobuf.json_format import MessageToJson
from carball.controls.controls import ControlsCreator
from carball.decompile_replays import analyze_replay_file
from carball.json_parser.sanity_check.sanity_check import SanityCheck... | 37.888889 | 115 | 0.631232 |
5b26f9aecc10af18d8dc6523fa2721c35720e61d | 2,677 | py | Python | search_service/config.py | Raybeam/amundsensearchlibrary | 6bf1cc36fea0cd6a3c047e93d7f5a1614e61f16b | [
"Apache-2.0"
] | null | null | null | search_service/config.py | Raybeam/amundsensearchlibrary | 6bf1cc36fea0cd6a3c047e93d7f5a1614e61f16b | [
"Apache-2.0"
] | null | null | null | search_service/config.py | Raybeam/amundsensearchlibrary | 6bf1cc36fea0cd6a3c047e93d7f5a1614e61f16b | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import os
ELASTICSEARCH_INDEX_KEY = 'ELASTICSEARCH_INDEX'
SEARCH_PAGE_SIZE_KEY = 'SEARCH_PAGE_SIZE'
STATS_FEATURE_KEY = 'STATS'
PROXY_ENDPOINT = 'PROXY_ENDPOINT'
PROXY_USER = 'PROXY_USER'
PROXY_PASSWORD = 'PROXY_PASSWORD'
PROXY_C... | 33.4625 | 108 | 0.652223 |
699cab23d55ea44a228d687e792f9b737c986e8f | 3,386 | py | Python | docs/sjqruaw/stonks/solve.py | polychromatic-blackguardist/polychromatic-blackguardist.github.io | c6b2b08b98daf68a958076fa05dc71bb3f29dcf8 | [
"BSD-3-Clause"
] | null | null | null | docs/sjqruaw/stonks/solve.py | polychromatic-blackguardist/polychromatic-blackguardist.github.io | c6b2b08b98daf68a958076fa05dc71bb3f29dcf8 | [
"BSD-3-Clause"
] | null | null | null | docs/sjqruaw/stonks/solve.py | polychromatic-blackguardist/polychromatic-blackguardist.github.io | c6b2b08b98daf68a958076fa05dc71bb3f29dcf8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import os
import subprocess
import sys
import tempfile
from typing import Union
from pwn import *
def usage(err=None):
if err is not None:
print(f"error: {err}")
print(
"usage: one of\n"
" solve.py local <path to vuln.c> <path to flag file>"
" solve.py... | 30.232143 | 76 | 0.581512 |
77ac7a4deecd92788004a766577708f14d78712f | 1,484 | py | Python | utils/helpers.py | Bick95/text2rdf | 9e8570bbeb58b6e961e5905990ede4ed219dae37 | [
"MIT"
] | 2 | 2020-11-17T11:06:05.000Z | 2020-11-27T15:46:19.000Z | utils/helpers.py | Bick95/text2rdf | 9e8570bbeb58b6e961e5905990ede4ed219dae37 | [
"MIT"
] | null | null | null | utils/helpers.py | Bick95/text2rdf | 9e8570bbeb58b6e961e5905990ede4ed219dae37 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# Imports
# Bleu score
from nltk.translate.bleu_score import corpus_bleu
def rdf_vocab_constructor(raw_vocab):
vocab_count, word2idx, idx2word = 3, {'START': 0, 'PAD': 1, 'END': 2}, {0: 'START', 1: 'PAD', 2: 'END'}
for partition in raw_vocab: # Different partitions wit... | 40.108108 | 107 | 0.59434 |
d713ee46214d76f1b5edb57e765ae9d4c8a0ccf1 | 3,567 | py | Python | Myour/settings.py | majeedkarimi/resume_Myour | d632df4898155e956a73734c53d4086716d54ff0 | [
"MIT"
] | null | null | null | Myour/settings.py | majeedkarimi/resume_Myour | d632df4898155e956a73734c53d4086716d54ff0 | [
"MIT"
] | null | null | null | Myour/settings.py | majeedkarimi/resume_Myour | d632df4898155e956a73734c53d4086716d54ff0 | [
"MIT"
] | null | null | null | """
Django settings for Myour project.
Generated by 'django-admin startproject' using Django 3.2.12.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib ... | 25.297872 | 91 | 0.703673 |
b0fed2804a539b476f3be8e707851aabd86fa019 | 481 | py | Python | openapi_core/unmarshalling/schemas/formatters.py | eyadgaran/openapi-core | ff4a6c81eeda0e2274aa9dc03597779c141e5728 | [
"BSD-3-Clause"
] | 1 | 2021-07-14T14:43:22.000Z | 2021-07-14T14:43:22.000Z | openapi_core/unmarshalling/schemas/formatters.py | eyadgaran/openapi-core | ff4a6c81eeda0e2274aa9dc03597779c141e5728 | [
"BSD-3-Clause"
] | 9 | 2021-07-13T22:19:17.000Z | 2022-01-05T22:12:31.000Z | openapi_core/unmarshalling/schemas/formatters.py | eyadgaran/openapi-core | ff4a6c81eeda0e2274aa9dc03597779c141e5728 | [
"BSD-3-Clause"
] | 1 | 2022-01-19T21:23:56.000Z | 2022-01-19T21:23:56.000Z | class Formatter(object):
def validate(self, value):
return True
def unmarshal(self, value):
return value
@classmethod
def from_callables(cls, validate=None, unmarshal=None):
attrs = {}
if validate is not None:
attrs['validate'] = staticmethod(validate)
... | 25.315789 | 59 | 0.596674 |
fbcf8eaa0b78fccedb44d7b2d7a0d979cf3e8351 | 4,104 | py | Python | twitoff/twitter.py | jproctor-rebecca/twitoff | 93d0e298678f3ee2d9d01ed7855cc1db54dd8892 | [
"MIT"
] | null | null | null | twitoff/twitter.py | jproctor-rebecca/twitoff | 93d0e298678f3ee2d9d01ed7855cc1db54dd8892 | [
"MIT"
] | null | null | null | twitoff/twitter.py | jproctor-rebecca/twitoff | 93d0e298678f3ee2d9d01ed7855cc1db54dd8892 | [
"MIT"
] | null | null | null | '''
retrieve tweets from Twitter
and embeddings from Spacy
and persist in the database
RJProctor
'''
from os import getenv
import tweepy
from .models import DB, Tweet, User
import spacy
# https://greatist.com/happiness/must-follow-twitter-accounts
TWITTER_USERS = ['calebhicks', 'elonmusk', 'rrherr','St... | 33.365854 | 124 | 0.60575 |
4378ab75ea618e5b73b6d77af3415685efbb319e | 7,487 | py | Python | ceph_deploy/tests/test_remotes.py | rleimenstoll/ceph-deploy | 70aca4051457cb6aa1673bfb6f79bb359d0699f6 | [
"MIT"
] | null | null | null | ceph_deploy/tests/test_remotes.py | rleimenstoll/ceph-deploy | 70aca4051457cb6aa1673bfb6f79bb359d0699f6 | [
"MIT"
] | null | null | null | ceph_deploy/tests/test_remotes.py | rleimenstoll/ceph-deploy | 70aca4051457cb6aa1673bfb6f79bb359d0699f6 | [
"MIT"
] | null | null | null | from mock import patch
from ceph_deploy.hosts import remotes
from ceph_deploy.hosts.remotes import platform_information, parse_os_release
class FakeExists(object):
def __init__(self, existing_paths):
self.existing_paths = existing_paths
def __call__(self, path):
for existing_path in self.exis... | 31.590717 | 78 | 0.664485 |
5b3fc83e3152debd3855056fda687a1983fab04c | 73 | py | Python | jupyter_auth/_version.py | pierrotsmnrd/jupyter-auth | f0bf5b46944bf1f807ffd039e76bf15752c0ca8b | [
"BSD-3-Clause"
] | 1 | 2021-05-13T11:10:19.000Z | 2021-05-13T11:10:19.000Z | jupyter_auth/_version.py | pierrotsmnrd/jupyter-auth | f0bf5b46944bf1f807ffd039e76bf15752c0ca8b | [
"BSD-3-Clause"
] | null | null | null | jupyter_auth/_version.py | pierrotsmnrd/jupyter-auth | f0bf5b46944bf1f807ffd039e76bf15752c0ca8b | [
"BSD-3-Clause"
] | 1 | 2021-05-05T13:34:22.000Z | 2021-05-05T13:34:22.000Z | version_info = (0, 0, 1)
__version__ = ".".join(map(str, version_info))
| 18.25 | 46 | 0.657534 |
5e5e2e7696afc59e6cf82f39ebe22cc297ab7301 | 3,882 | py | Python | python/filtered_stream.py | extrathought/mappin | 3d8c7f73a62899d6404866d147b720b2d0620e13 | [
"MIT"
] | null | null | null | python/filtered_stream.py | extrathought/mappin | 3d8c7f73a62899d6404866d147b720b2d0620e13 | [
"MIT"
] | null | null | null | python/filtered_stream.py | extrathought/mappin | 3d8c7f73a62899d6404866d147b720b2d0620e13 | [
"MIT"
] | null | null | null | ##
##Version 0.1 of the Social Media Map for Twitter
##Accesses Twitter APIs and executes the code
##Uses: Twitter APIv2
##https://developer.twitter.com/en/docs/twitter-api/early-access
##
import requests
import os
import json
import argparse
# To set your enviornment variables in your terminal run the following ... | 31.306452 | 244 | 0.654817 |
2e6e0807c72a8d865de272a3ce7dcf2317c9c49e | 3,683 | py | Python | conf/settings.py | lindychi/planned-server | 8f752d19441627e007228c820cbdf876b70ac13c | [
"MIT"
] | null | null | null | conf/settings.py | lindychi/planned-server | 8f752d19441627e007228c820cbdf876b70ac13c | [
"MIT"
] | 24 | 2021-04-20T11:41:28.000Z | 2021-06-27T10:03:48.000Z | conf/settings.py | lindychi/planned-server | 8f752d19441627e007228c820cbdf876b70ac13c | [
"MIT"
] | null | null | null | """
Django settings for conf project.
Generated by 'django-admin startproject' using Django 3.1.2.
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/
"""
import os
from ... | 24.718121 | 91 | 0.698344 |
71ece53923c79d59ee44b0c3071f225a7aff3be5 | 315 | py | Python | hpy/debug/__init__.py | pyhandle/hpy | f9b80ca9dd719499488b7fec1f5bb676a7bb1974 | [
"MIT"
] | 262 | 2019-07-22T06:46:30.000Z | 2020-09-03T04:28:27.000Z | hpy/debug/__init__.py | pyhandle/hpy | f9b80ca9dd719499488b7fec1f5bb676a7bb1974 | [
"MIT"
] | 39 | 2019-07-21T22:51:51.000Z | 2020-09-02T12:32:48.000Z | hpy/debug/__init__.py | pyhandle/hpy | f9b80ca9dd719499488b7fec1f5bb676a7bb1974 | [
"MIT"
] | 18 | 2019-07-24T09:47:51.000Z | 2020-09-02T11:09:26.000Z | from .leakdetector import HPyDebugError, HPyLeakError, LeakDetector
def set_handle_stack_trace_limit(limit):
from hpy.universal import _debug
_debug.set_handle_stack_trace_limit(limit)
def disable_handle_stack_traces():
from hpy.universal import _debug
_debug.set_handle_stack_trace_limit(None)
| 26.25 | 67 | 0.819048 |
e74e98cde25ebceba3df53638997347a8e1474dd | 3,166 | py | Python | profiles_project/settings.py | sayantabonny/profiles-rest-api | 2442cc995400469453c9a5c85af22e3aa60b186f | [
"MIT"
] | null | null | null | profiles_project/settings.py | sayantabonny/profiles-rest-api | 2442cc995400469453c9a5c85af22e3aa60b186f | [
"MIT"
] | null | null | null | profiles_project/settings.py | sayantabonny/profiles-rest-api | 2442cc995400469453c9a5c85af22e3aa60b186f | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 3.1.5.
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/
"""
fro... | 25.532258 | 91 | 0.695831 |
afbea96726ca979f70a37aba5039b4756baf6298 | 177 | py | Python | lgadtools/__init__.py | SengerM/lgadtools | 16f55dbd30a6cd2b39d9d4d107500ed5e7e7802e | [
"MIT"
] | 1 | 2020-10-07T08:46:41.000Z | 2020-10-07T08:46:41.000Z | lgadtools/__init__.py | SengerM/lgadtools | 16f55dbd30a6cd2b39d9d4d107500ed5e7e7802e | [
"MIT"
] | null | null | null | lgadtools/__init__.py | SengerM/lgadtools | 16f55dbd30a6cd2b39d9d4d107500ed5e7e7802e | [
"MIT"
] | null | null | null | name = "lgadtools"
# Numerical version:
__version_info__ = (1, 0, 0)
__version__ = '.'.join(map(str, __version_info__))
__author__ = 'Matias H. Senger <m.senger@hotmail.com>'
| 22.125 | 54 | 0.706215 |
db57ac84c9075f1ba8c074b3c8a655b9cd9f7e87 | 4,922 | py | Python | emu2influx.py | don4of4/emu2influx | fb6468fd989cc3fb3e43848757161f58c90f83e6 | [
"Apache-2.0"
] | null | null | null | emu2influx.py | don4of4/emu2influx | fb6468fd989cc3fb3e43848757161f58c90f83e6 | [
"Apache-2.0"
] | null | null | null | emu2influx.py | don4of4/emu2influx | fb6468fd989cc3fb3e43848757161f58c90f83e6 | [
"Apache-2.0"
] | null | null | null | import logging
import sys
import os
from datetime import datetime
from influxdb import InfluxDBClient
from emu import *
Y2K = 946684800
int_max = 2**31-1
uint_max = 2**32-1
def get_timestamp(obj):
# print obj.TimeStamp
if obj.TimeStamp is None:
obj.TimeStamp = "0x0"
return datetime.utcfromtimes... | 35.666667 | 106 | 0.561357 |
0a523e9ff99456f657f5aae5eddbc7233a04092f | 453 | py | Python | utils/set_path.py | eciraci/offsets_blending | 6d36eb6434198a5e8548375c6f80e92e872e9328 | [
"MIT"
] | null | null | null | utils/set_path.py | eciraci/offsets_blending | 6d36eb6434198a5e8548375c6f80e92e872e9328 | [
"MIT"
] | null | null | null | utils/set_path.py | eciraci/offsets_blending | 6d36eb6434198a5e8548375c6f80e92e872e9328 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
u"""
Project Utility Functions
"""
# - python dependencies
import os
import pathlib
def set_path_to_data_dir() -> pathlib.Path:
"""
Return absolute path tp project data directory.
:return: data_dir path, pathlib.Path
"""
return pathlib.Path(os.path.join('/', 'Volumes', 'Googl... | 25.166667 | 68 | 0.578366 |
4e4888d7b77b2d62c136bdbacc29d616fad9cb21 | 10,855 | py | Python | __init__.py | muhareb/skill-playback-control | 2698ce698ec9f557c98c494372735e9e97154496 | [
"Apache-2.0"
] | null | null | null | __init__.py | muhareb/skill-playback-control | 2698ce698ec9f557c98c494372735e9e97154496 | [
"Apache-2.0"
] | null | null | null | __init__.py | muhareb/skill-playback-control | 2698ce698ec9f557c98c494372735e9e97154496 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 43.770161 | 86 | 0.580193 |
ba9a55862c691eebc5a0b3d9b098de9313852534 | 500 | py | Python | tweetrel/_nbdev.py | fastai/tweetrel | 34a5e73fc8db3af966e402d687a26fdd6cff053f | [
"Apache-2.0"
] | 16 | 2020-12-03T07:00:26.000Z | 2021-05-23T14:51:39.000Z | tweetrel/_nbdev.py | fastai/tweetrel | 34a5e73fc8db3af966e402d687a26fdd6cff053f | [
"Apache-2.0"
] | 27 | 2021-05-04T21:44:01.000Z | 2022-03-20T03:07:52.000Z | tweetrel/_nbdev.py | fastai/tweetrel | 34a5e73fc8db3af966e402d687a26fdd6cff053f | [
"Apache-2.0"
] | 1 | 2020-12-03T16:50:53.000Z | 2020-12-03T16:50:53.000Z | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"auth": "00_core.ipynb",
"twitter_api": "00_core.ipynb",
"example_rel": "00_core.ipynb",
"tweet_text": "00_core.ipynb",
"send_tweet": "00_core.ipynb",
"install": "... | 26.315789 | 61 | 0.636 |
399d59134ca9d707c6bce98d140514102e936ab1 | 1,432 | py | Python | deepchem/feat/tests/test_convmol.py | martonlanga/deepchem | af2db874484603ade489fa513eac193b38ce6d56 | [
"MIT"
] | 2 | 2021-04-01T01:17:53.000Z | 2021-10-04T16:46:13.000Z | deepchem/feat/tests/test_convmol.py | evenhe/deepchem | 9d0fc5554b286117ae08b21b3f15877b06a1009e | [
"MIT"
] | 1 | 2020-07-13T18:59:49.000Z | 2020-07-13T18:59:49.000Z | deepchem/feat/tests/test_convmol.py | fenomeinc/deepchem | 1c007fbae899a49fe3c40f41e7273ed21867fef9 | [
"MIT"
] | 1 | 2021-04-06T20:32:02.000Z | 2021-04-06T20:32:02.000Z | from unittest import TestCase
import numpy as np
from deepchem.feat import ConvMolFeaturizer
from deepchem.feat.mol_graphs import ConvMol
from deepchem.molnet import load_bace_classification
class TestConvMol(TestCase):
def get_molecules(self):
tasks, all_dataset, transformers = load_bace_classification(
... | 34.095238 | 74 | 0.740223 |
6d595450be3d7415cb13d8bea17046dc4bce1155 | 12,187 | py | Python | flask/lib/python2.7/site-packages/sqlalchemy/sql/default_comparator.py | blackbliss/callme | fe254ef4c3af36ab7a65f3de0071d2c79375e3e0 | [
"MIT"
] | 2 | 2015-11-05T09:43:45.000Z | 2017-05-31T14:22:02.000Z | flask/lib/python2.7/site-packages/sqlalchemy/sql/default_comparator.py | blackbliss/callme | fe254ef4c3af36ab7a65f3de0071d2c79375e3e0 | [
"MIT"
] | 4 | 2017-10-24T22:44:01.000Z | 2017-10-24T22:44:19.000Z | flask/lib/python2.7/site-packages/sqlalchemy/sql/default_comparator.py | blackbliss/callme | fe254ef4c3af36ab7a65f3de0071d2c79375e3e0 | [
"MIT"
] | 1 | 2021-04-16T11:10:59.000Z | 2021-04-16T11:10:59.000Z | # sql/default_comparator.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Default implementation of SQL comparison operations.
"""
from .. import ... | 43.063604 | 84 | 0.578157 |
63ba5f6b48007abd50add88364753d9f7fbec8d8 | 497 | py | Python | project/api/views/support.py | 4383/recalbox-manager | 4da0f10d6b7c47d40b6550b3e9f96c6ee90a53bb | [
"MIT"
] | 61 | 2016-11-07T02:16:48.000Z | 2021-09-22T19:32:14.000Z | project/api/views/support.py | DOCK-PI3/MasOS-Manager | ea5e2e6a20dc7853b5c1eeeb7f5dd358bff6d4b7 | [
"MIT"
] | 36 | 2015-12-05T10:24:27.000Z | 2019-06-25T10:50:29.000Z | project/api/views/support.py | DOCK-PI3/MasOS-Manager | ea5e2e6a20dc7853b5c1eeeb7f5dd358bff6d4b7 | [
"MIT"
] | 33 | 2017-01-02T16:07:25.000Z | 2022-02-08T05:09:02.000Z | """
Support views
"""
from project.api.views import ApiBaseJsonView
from project.utils.cli_process import SimpleCaller
class SupportScriptView(ApiBaseJsonView):
_default_state = 'pending'
def get(self, request, *args, **kwargs):
self.call()
return super(SupportScriptView, self).get(request... | 26.157895 | 75 | 0.645875 |
1735f4dd19e56ad079680a3e5aa01adaa5f983a0 | 35,316 | py | Python | yt/frontends/fits/data_structures.py | kuochuanpan/yt | bfc029095e7a701cfc58de38628ff2ec08c169c6 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/frontends/fits/data_structures.py | kuochuanpan/yt | bfc029095e7a701cfc58de38628ff2ec08c169c6 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/frontends/fits/data_structures.py | kuochuanpan/yt | bfc029095e7a701cfc58de38628ff2ec08c169c6 | [
"BSD-3-Clause-Clear"
] | null | null | null | import os
import time
import uuid
import warnings
import weakref
from collections import defaultdict
import numpy as np
import numpy.core.defchararray as np_char
from more_itertools import always_iterable
from yt.config import ytcfg
from yt.data_objects.index_subobjects.grid_patch import AMRGridPatch
from yt.data_obj... | 37.771123 | 88 | 0.565891 |
f1ba559e56a5fca3f98932ef3bae9855de38ebf3 | 18,186 | py | Python | src/cluecode/finder.py | doc22940/scancode-toolk | 588b9a9411730e99d763d715ae9f38575744aaee | [
"Apache-2.0",
"CC0-1.0"
] | 1 | 2020-06-24T16:03:52.000Z | 2020-06-24T16:03:52.000Z | src/cluecode/finder.py | doc22940/scancode-toolk | 588b9a9411730e99d763d715ae9f38575744aaee | [
"Apache-2.0",
"CC0-1.0"
] | 1 | 2021-06-02T02:50:07.000Z | 2021-06-02T02:50:07.000Z | src/cluecode/finder.py | hwpplayers/scancode-toolkit | 72850bd57a1a841e5a6a6e4120223a00c4189046 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | #
# Copyright (c) 2018 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | 30.109272 | 97 | 0.610085 |
3fbf29b7b28103c4b8b5f5ee3eaf53d14299ba49 | 4,594 | py | Python | cle/backends/relocation.py | embg/cle | e32b6d146ea38808f4f4419f0d05cddb7fe89671 | [
"BSD-2-Clause"
] | null | null | null | cle/backends/relocation.py | embg/cle | e32b6d146ea38808f4f4419f0d05cddb7fe89671 | [
"BSD-2-Clause"
] | null | null | null | cle/backends/relocation.py | embg/cle | e32b6d146ea38808f4f4419f0d05cddb7fe89671 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import print_function
import logging
from . import Backend
from .symbol import Symbol
from ..address_translator import AT
l = logging.getLogger('cle.backends.relocation')
class Relocation:
"""
A representation of a relocation in a binary file. Smart enough to
relocate itself.
:ivar ... | 36.752 | 154 | 0.63387 |
6f32c2c6d164562e5ec92f59404c24ce9a35bf3a | 232 | py | Python | Food_basket/admin.py | PopaGabriel/Food-Ecommerce-Site | 7f7cde94939f02f13df5afa865cddc72981481e2 | [
"MIT"
] | 1 | 2021-08-12T08:46:56.000Z | 2021-08-12T08:46:56.000Z | Food_basket/admin.py | PopaGabriel/Food-Ecommerce-Site | 7f7cde94939f02f13df5afa865cddc72981481e2 | [
"MIT"
] | null | null | null | Food_basket/admin.py | PopaGabriel/Food-Ecommerce-Site | 7f7cde94939f02f13df5afa865cddc72981481e2 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Basket
class BasketAdmin(admin.ModelAdmin):
list_display = ['restaurant', 'user', 'get_total_price']
admin.site.register(Basket, BasketAdmin)
# Register your models here.
| 21.090909 | 60 | 0.767241 |
cabeadc843fa8b39ed6fb83a462cedf5d11a0dde | 3,534 | py | Python | mnist/mnist_demo.py | yangydeng/tf_slim_learn | bf9cc645472c83f49fc4245ce84e88bfb65220db | [
"MIT"
] | null | null | null | mnist/mnist_demo.py | yangydeng/tf_slim_learn | bf9cc645472c83f49fc4245ce84e88bfb65220db | [
"MIT"
] | null | null | null | mnist/mnist_demo.py | yangydeng/tf_slim_learn | bf9cc645472c83f49fc4245ce84e88bfb65220db | [
"MIT"
] | null | null | null | '''
@Date : 2017-12-13 10:56
@Author: yangyang Deng
@Email : yangydeng@163.com
@Describe:
使用tf-slim构建 cnn网络, 用于识别mnist.
'''
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
BATCH_SIZE = 50
STEPS = 20000
LEARNING_RATE = 1... | 36.8125 | 144 | 0.645727 |
99e5e367b9f24fdb1d52393833dfa4b603cbe733 | 165 | py | Python | Basics/tabuada.py | RodrigoFranciozi/Learning-Python | ef4f7dc934ff6a2d82414d6b7fca3c968506dd52 | [
"MIT"
] | null | null | null | Basics/tabuada.py | RodrigoFranciozi/Learning-Python | ef4f7dc934ff6a2d82414d6b7fca3c968506dd52 | [
"MIT"
] | null | null | null | Basics/tabuada.py | RodrigoFranciozi/Learning-Python | ef4f7dc934ff6a2d82414d6b7fca3c968506dd52 | [
"MIT"
] | null | null | null | import time
num = int(input('Digite o número que deseja saber a tabuada:'))
for c in range(1, 11):
print('{} x {:2} = {}'.format(num,c,num*c))
time.sleep(1500)
| 23.571429 | 63 | 0.630303 |
8a471c1d66b98e44c58141ac9a38b2c279a36567 | 633 | py | Python | mmdet/models/saliency_detectors/__init__.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | mmdet/models/saliency_detectors/__init__.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | mmdet/models/saliency_detectors/__init__.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # ---------------------------------------------------------------
# __init__.py
# Set-up time: 2021/5/12 11:01
# Copyright (c) 2020 ICT
# Licensed under The MIT License [see LICENSE for details]
# Written by Kenneth-Wong (Wenbin-Wang) @ VIPL.ICT
# Contact: wenbin.wang@vipl.ict.ac.cn [OR] nkwangwenbin@gmail.com
#... | 45.214286 | 82 | 0.616114 |
97182622179edc8575a98bf0928b27eb26cab6f3 | 6,175 | py | Python | deprecated_paradigms/paradigm_drives_long.py | danielmk/pyDentate | df8f67d4523ce463701c5e5675e74e309dd151e7 | [
"MIT"
] | 1 | 2022-02-24T20:39:46.000Z | 2022-02-24T20:39:46.000Z | deprecated_paradigms/paradigm_drives_long.py | danielmk/pydentate | df8f67d4523ce463701c5e5675e74e309dd151e7 | [
"MIT"
] | null | null | null | deprecated_paradigms/paradigm_drives_long.py | danielmk/pydentate | df8f67d4523ce463701c5e5675e74e309dd151e7 | [
"MIT"
] | 4 | 2021-11-02T07:47:42.000Z | 2021-11-30T09:07:35.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 05 13:41:23 2018
@author: DanielM
"""
from neuron import h, gui # gui necessary for some parameters to h namespace
import numpy as np
import net_ppdynamicsoff
from input_generator import inhom_poiss
import os
import argparse
import time
from analysis_main import time_s... | 39.83871 | 145 | 0.546397 |
86168f74c0bb2c056770ebab7217ec9d5c065a7e | 2,981 | py | Python | rnn.py | ribhav-jain/Stock-Price-Prediction | 1c88fbdd3442aacb19652b834a0cb5dbc41d1389 | [
"MIT"
] | null | null | null | rnn.py | ribhav-jain/Stock-Price-Prediction | 1c88fbdd3442aacb19652b834a0cb5dbc41d1389 | [
"MIT"
] | null | null | null | rnn.py | ribhav-jain/Stock-Price-Prediction | 1c88fbdd3442aacb19652b834a0cb5dbc41d1389 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Ribhav Jain
"""
# Recurrent Neural Network
# Importing the libraries
import numpy as np
import pandas as pd
# Importing the training set
dataset_train = pd.read_csv('dataset/Google_Stock_Price_Train.csv')
training_set = dataset_train.iloc[:, 1:2].values
# Feature Scaling
from skl... | 31.052083 | 93 | 0.758135 |
103c38819bb056a70f6cf6f17d0bf5239492c1eb | 1,701 | py | Python | homeassistant/components/worldclock/sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-05-18T10:18:16.000Z | 2020-12-08T11:27:55.000Z | homeassistant/components/worldclock/sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | homeassistant/components/worldclock/sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 6 | 2020-04-10T06:21:11.000Z | 2021-07-01T08:53:38.000Z | """Support for showing the time in a different time zone."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_TIME_ZONE
import homeassistant.util.dt as dt_util
from homeassistant.helpers.entity import Entity
import home... | 27 | 86 | 0.697825 |
8d8e847c168da893af8df70eaa5ce7882513503b | 4,020 | py | Python | mars/tensor/expressions/reduction/argmax.py | lmatz/mars | 45f9166b54eb91b21e66cef8b590a41aa8ac9569 | [
"Apache-2.0"
] | 1 | 2018-12-26T08:37:04.000Z | 2018-12-26T08:37:04.000Z | mars/tensor/expressions/reduction/argmax.py | lmatz/mars | 45f9166b54eb91b21e66cef8b590a41aa8ac9569 | [
"Apache-2.0"
] | null | null | null | mars/tensor/expressions/reduction/argmax.py | lmatz/mars | 45f9166b54eb91b21e66cef8b590a41aa8ac9569 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | 34.655172 | 99 | 0.642537 |
6a275f1e924eb96e8737876c7d9814c3b0822ab5 | 6,262 | py | Python | tests/core/tests/throttle.py | uditagarwal/tastypie | ece398310040e9ddfeeacee6a699beb1dee6dad6 | [
"BSD-3-Clause"
] | 1 | 2015-05-20T16:20:43.000Z | 2015-05-20T16:20:43.000Z | tests/core/tests/throttle.py | uditagarwal/tastypie | ece398310040e9ddfeeacee6a699beb1dee6dad6 | [
"BSD-3-Clause"
] | 3 | 2016-10-25T12:00:28.000Z | 2022-02-10T10:04:24.000Z | tests/core/tests/throttle.py | uditagarwal/tastypie | ece398310040e9ddfeeacee6a699beb1dee6dad6 | [
"BSD-3-Clause"
] | 1 | 2019-09-29T04:13:39.000Z | 2019-09-29T04:13:39.000Z | import time
from django.core.cache import cache
from django.test import TestCase
from django.utils.encoding import force_text
from tastypie.models import ApiAccess
from tastypie.throttle import BaseThrottle, CacheThrottle, CacheDBThrottle
class NoThrottleTestCase(TestCase):
def test_init(self):
throttle... | 44.098592 | 96 | 0.701054 |
37b84310a0f629e8412e02f31145da7280efe251 | 44,367 | py | Python | productores/migrations/0001_initial.py | ErickMurillo/aprocacaho | eecd216103e6b06e3ece174c89d911f27b50585a | [
"MIT"
] | null | null | null | productores/migrations/0001_initial.py | ErickMurillo/aprocacaho | eecd216103e6b06e3ece174c89d911f27b50585a | [
"MIT"
] | 7 | 2020-06-05T17:11:32.000Z | 2022-03-11T23:14:00.000Z | productores/migrations/0001_initial.py | ErickMurillo/aprocacaho | eecd216103e6b06e3ece174c89d911f27b50585a | [
"MIT"
] | 1 | 2016-07-04T18:38:14.000Z | 2016-07-04T18:38:14.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-09 17:00
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import multiselectfield.db.fields
import smart_selects.db_fields
class Migration(migrations.Migrat... | 64.959004 | 569 | 0.598778 |
80157516c741e602721732a0008f63f2d419d270 | 30,353 | py | Python | test/functional/rpc_rawtransaction.py | fujicoin/fujicoin-22.0 | acdf52ee4b54ba24e904fb2ed0cb578b2d755e48 | [
"MIT"
] | 17 | 2017-03-21T11:33:12.000Z | 2021-08-10T04:11:30.000Z | test/functional/rpc_rawtransaction.py | fujicoin/fujicoin-22.0 | acdf52ee4b54ba24e904fb2ed0cb578b2d755e48 | [
"MIT"
] | 2 | 2018-01-20T04:45:53.000Z | 2020-01-06T19:52:13.000Z | test/functional/rpc_rawtransaction.py | fujicoin/fujicoin | acdf52ee4b54ba24e904fb2ed0cb578b2d755e48 | [
"MIT"
] | 7 | 2017-02-12T08:49:39.000Z | 2021-07-18T11:33:59.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Fujicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the rawtransaction RPCs.
Test the following RPCs:
- createrawtransaction
- signrawtransact... | 58.259117 | 601 | 0.6544 |
dbfe96748d96edccf5b812ce9a3cd20614eb1245 | 503 | py | Python | scrape_imdb/movies/management/commands/scrape_movies.py | mesmerlord/imdb_scrape | 5c2ea24d18e5bce75ab7183a88240025ca02342e | [
"MIT"
] | null | null | null | scrape_imdb/movies/management/commands/scrape_movies.py | mesmerlord/imdb_scrape | 5c2ea24d18e5bce75ab7183a88240025ca02342e | [
"MIT"
] | null | null | null | scrape_imdb/movies/management/commands/scrape_movies.py | mesmerlord/imdb_scrape | 5c2ea24d18e5bce75ab7183a88240025ca02342e | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from scrape_imdb.movies.tasks import scrape_function
class Command(BaseCommand):
help = "Scrape movies from IMDB and update model in database"
def handle(self, *args, **options):
created_movies, updated_movies = scrape_function()
... | 31.4375 | 103 | 0.681909 |
efa36be4a9c3a5762388d5d6df5bbc7add978489 | 6,724 | py | Python | face detect and track/demo - detect and track.py | aadebuger/face-recognition | bd5c814eea2862d9a87e69524a4136199db09066 | [
"MIT"
] | 91 | 2017-03-07T16:30:56.000Z | 2021-10-12T03:19:22.000Z | face detect and track/demo - detect and track.py | aadebuger/face-recognition | bd5c814eea2862d9a87e69524a4136199db09066 | [
"MIT"
] | 3 | 2017-05-19T00:10:04.000Z | 2019-07-24T11:12:04.000Z | face detect and track/demo - detect and track.py | aadebuger/face-recognition | bd5c814eea2862d9a87e69524a4136199db09066 | [
"MIT"
] | 54 | 2017-04-26T03:15:55.000Z | 2022-03-25T07:53:51.000Z | #!/usr/bin/python
'''
Author: Guido Diepen <gdiepen@deloitte.nl>
'''
#Import the OpenCV and dlib libraries
import cv2
import dlib
#Initialize a face cascade using the frontal face haar cascade provided with
#the OpenCV library
faceCascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
#The deisr... | 35.204188 | 76 | 0.550863 |
5b74a803f57e6b4f0e3b197abb75f5bfc824f477 | 934 | py | Python | numbas_lti/migrations/0022_discountpart.py | oscarsiles/numbas-lti-provider | ef7080a2593a800a1b9630c746e4f8667e2ec42d | [
"Apache-2.0"
] | 6 | 2016-12-12T14:41:33.000Z | 2021-04-18T01:04:23.000Z | numbas_lti/migrations/0022_discountpart.py | oscarsiles/numbas-lti-provider | ef7080a2593a800a1b9630c746e4f8667e2ec42d | [
"Apache-2.0"
] | 206 | 2016-08-24T13:53:07.000Z | 2022-03-31T09:14:43.000Z | numbas_lti/migrations/0022_discountpart.py | oscarsiles/numbas-lti-provider | ef7080a2593a800a1b9630c746e4f8667e2ec42d | [
"Apache-2.0"
] | 13 | 2016-10-23T04:53:30.000Z | 2022-02-17T09:25:00.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-10-13 08:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('numbas_lti', '0021_remarkpart'),
]
operations = [
... | 35.923077 | 169 | 0.632762 |
e6b9b89bea954f5740331d1c801cd278d97a17c7 | 1,011 | py | Python | ubb/fop/BusCompani_exam/tester/tester.py | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | null | null | null | ubb/fop/BusCompani_exam/tester/tester.py | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | 6 | 2020-03-04T20:52:39.000Z | 2022-03-31T00:33:07.000Z | ubb/fop/BusCompani_exam/tester/tester.py | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | null | null | null | from model.route import Route
from controller.controller import Controller
from repository.repository import Repository
class Tester:
def __init__(self):
self.test()
def test(self):
x = Route(1,"24b",93,3)
assert(x.getId() == 1)
x.setId(2)
assert(x.getId() == 2)
... | 32.612903 | 99 | 0.537092 |
4525df8d23ec2eaff00f67c2f2ab6b470be746b9 | 878 | py | Python | ctci/chapter1/strcompression.py | rm21845/ctci | 2b9d6fc13d51affbd01882b67277cf7c847a2c9c | [
"MIT"
] | null | null | null | ctci/chapter1/strcompression.py | rm21845/ctci | 2b9d6fc13d51affbd01882b67277cf7c847a2c9c | [
"MIT"
] | null | null | null | ctci/chapter1/strcompression.py | rm21845/ctci | 2b9d6fc13d51affbd01882b67277cf7c847a2c9c | [
"MIT"
] | null | null | null | """Solution to 1.6: String Compression."""
def compress(string):
"""Creates a compressed string using repeat characters.
Args:
string_one: any string to be compressed.
Returns:
A compressed version of the input based on repeat occurences
Raises:
ValueError: string input ... | 26.606061 | 68 | 0.531891 |
6ddfb01793746cd599fbc72f76a9f732f3c797a3 | 30 | py | Python | superinvoke/collections/__init__.py | Neoxelox/superinvoke | 032dde6d31ecd4fa94b3fd75ca2f09ccf799e9ba | [
"MIT"
] | 1 | 2021-11-15T01:25:00.000Z | 2021-11-15T01:25:00.000Z | superinvoke/collections/__init__.py | Neoxelox/superinvoke | 032dde6d31ecd4fa94b3fd75ca2f09ccf799e9ba | [
"MIT"
] | null | null | null | superinvoke/collections/__init__.py | Neoxelox/superinvoke | 032dde6d31ecd4fa94b3fd75ca2f09ccf799e9ba | [
"MIT"
] | null | null | null | from . import env, misc, tool
| 15 | 29 | 0.7 |
831e1c261b5c6203a10af42e48a4737faafdbead | 333 | py | Python | buoi3/bai2.py | Viet7501/viet1 | e0be1da1fb0f4736c8d0457733ccaaed9232c4e9 | [
"Apache-2.0"
] | null | null | null | buoi3/bai2.py | Viet7501/viet1 | e0be1da1fb0f4736c8d0457733ccaaed9232c4e9 | [
"Apache-2.0"
] | null | null | null | buoi3/bai2.py | Viet7501/viet1 | e0be1da1fb0f4736c8d0457733ccaaed9232c4e9 | [
"Apache-2.0"
] | null | null | null | n = int(input("Nhập n: "))
x = float(input("nhập x: "))
s_1 = 1
s_2 = 1
s_3 = 1
a = 1
b = 1
c = 1
for i in range(1, n + 1):
a = a * x
s_1 += a
print(s_1)
for i in range(1, n + 1):
b = b * (-x)
s_2 += b
print(s_2)
for i in range(1, n + 1):
c = c * (x / i)
s_3 += c
... | 11.892857 | 29 | 0.408408 |
b18acd138d21b804d083ff4b01d229a3cb7c67ba | 12,419 | py | Python | source_data/ScientificColourMaps4/cork/cork.py | franzhaas/cmlib | e313b1535d2823bc056d9b46973f6485ba781841 | [
"BSD-3-Clause"
] | 6 | 2020-02-22T11:37:19.000Z | 2022-01-14T09:10:21.000Z | source_data/ScientificColourMaps4/cork/cork.py | franzhaas/cmlib | e313b1535d2823bc056d9b46973f6485ba781841 | [
"BSD-3-Clause"
] | 1 | 2019-09-01T08:30:23.000Z | 2019-09-01T08:30:23.000Z | source_data/ScientificColourMaps4/cork/cork.py | franzhaas/cmlib | e313b1535d2823bc056d9b46973f6485ba781841 | [
"BSD-3-Clause"
] | 2 | 2020-02-22T11:38:08.000Z | 2021-12-25T12:06:59.000Z | #
# cork
# www.fabiocrameri.ch/visualisation
from matplotlib.colors import LinearSegmentedColormap
cm_data = [[0.17193, 0.10061, 0.29962],
[0.17176, 0.10673, 0.30545],
[0.17153, 0.11274, 0.31128],
[0.17124, 0.11871, 0.31714], ... | 44.512545 | 74 | 0.397053 |
7aa8f2f80a13e4313d826e6320d0113eb99bf6c8 | 74 | py | Python | stringtest.py | veronica-g/learning_python | ceeb1b01f30540f2c2af2ea475c8e4e6e28f7179 | [
"MIT"
] | null | null | null | stringtest.py | veronica-g/learning_python | ceeb1b01f30540f2c2af2ea475c8e4e6e28f7179 | [
"MIT"
] | null | null | null | stringtest.py | veronica-g/learning_python | ceeb1b01f30540f2c2af2ea475c8e4e6e28f7179 | [
"MIT"
] | null | null | null | string = "Hello World"
for x in string:
print (x, end='')
print ('\n') | 18.5 | 22 | 0.581081 |
1ab5c29956f4d16642efb62f57235fbbf63c4be9 | 6,950 | py | Python | pycrystal/tests/test_output_parser.py | tilde-lab/pycrystal | 62e2c7d2e7baa36daac864bdfdb2de89af7ac4b7 | [
"MIT"
] | 7 | 2019-02-02T05:38:24.000Z | 2022-03-23T09:26:37.000Z | pycrystal/tests/test_output_parser.py | tilde-lab/pycrystal | 62e2c7d2e7baa36daac864bdfdb2de89af7ac4b7 | [
"MIT"
] | 17 | 2019-02-09T16:08:35.000Z | 2021-04-09T04:59:57.000Z | pycrystal/tests/test_output_parser.py | tilde-lab/pycrystal | 62e2c7d2e7baa36daac864bdfdb2de89af7ac4b7 | [
"MIT"
] | 1 | 2021-06-04T05:07:38.000Z | 2021-06-04T05:07:38.000Z | # ---------------------------------------------
#
# The file test_output_parser.py is part of the pycrystal project.
# Copyright (c) 2019 Andrey Sobolev
# MIT License
# See http://github.com/tilde-lab/pycrystal for details
#
# ---------------------------------------------
import os
import pytest
from ase.units i... | 42.638037 | 98 | 0.551655 |
b86e66207472584ead75314a6d4d2a806211ce6a | 1,591 | py | Python | src/discreteonset/hainsworth/extendedKalmanFilter.py | stein2k/BeatTracking | 79e5e73f599588203dc87ba1816329d55c242500 | [
"MIT"
] | null | null | null | src/discreteonset/hainsworth/extendedKalmanFilter.py | stein2k/BeatTracking | 79e5e73f599588203dc87ba1816329d55c242500 | [
"MIT"
] | null | null | null | src/discreteonset/hainsworth/extendedKalmanFilter.py | stein2k/BeatTracking | 79e5e73f599588203dc87ba1816329d55c242500 | [
"MIT"
] | null | null | null | import numpy as np
def main():
q = 0.01
r = 0.02
Phi = np.array(((1,1),(0,1)),dtype=np.float64)
Q = q*np.array(((1.0/3.0,1.0/2.0),(1.0/2.0,1.0)),dtype=np.float64)
H = np.array(((1,0),),dtype=np.float64)
R = np.array((r,),dtype=np.float64)
state_actual = [None]*1001
state_observed = [... | 32.469388 | 83 | 0.57071 |
e79e824e3af4638b22bb9388caf7ebb30e6e0dd6 | 8,117 | py | Python | api/tests/opentrons/hardware_control/modules/test_hc_thermocycler.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | 2 | 2015-11-10T17:49:51.000Z | 2016-01-15T04:43:37.000Z | api/tests/opentrons/hardware_control/modules/test_hc_thermocycler.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | null | null | null | api/tests/opentrons/hardware_control/modules/test_hc_thermocycler.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | null | null | null | import asyncio
import mock
from typing import AsyncGenerator, cast
import pytest
from opentrons.drivers.rpi_drivers.types import USBPort
from opentrons.drivers.thermocycler import SimulatingDriver
from opentrons.hardware_control import modules, ExecutionManager
@pytest.fixture
def usb_port() -> USBPort:
return ... | 34.248945 | 103 | 0.727609 |
e1c2ae71a1f4bde0de96782562831a6c1617bc25 | 1,083 | py | Python | backend/src/modules/subtask.py | baealex/Medium-Clone-in-Django | 1f388ca9d75c05ce3100dfb7ad58ef751c964d19 | [
"MIT"
] | 34 | 2019-11-07T03:58:43.000Z | 2022-03-31T13:27:39.000Z | backend/src/modules/subtask.py | baealex/Medium-Clone-in-Django | 1f388ca9d75c05ce3100dfb7ad58ef751c964d19 | [
"MIT"
] | 16 | 2019-11-07T04:28:20.000Z | 2022-01-14T04:42:29.000Z | backend/src/modules/subtask.py | baealex/Medium-Clone-in-Django | 1f388ca9d75c05ce3100dfb7ad58ef751c964d19 | [
"MIT"
] | 10 | 2020-01-12T05:18:24.000Z | 2022-02-12T01:13:28.000Z | import asyncio
import time
import traceback
from functools import wraps, partial
from threading import Thread
def asynchronously(func):
@wraps(func)
async def coro(*args, loop=None, executor=None, **kwargs):
if loop is None:
loop = asyncio.get_event_loop()
partial_func = partial(fu... | 27.075 | 65 | 0.642659 |
c2afd337ca87448217f80220077eb59662c7d066 | 3,119 | py | Python | apps/modules/user/process/get_or_update_user.py | Bension/osroom | 59148fbaf6068dd700a7f9dfb8e8a6882c2a5e67 | [
"BSD-2-Clause"
] | 579 | 2017-11-29T15:34:14.000Z | 2022-03-28T13:23:53.000Z | apps/modules/user/process/get_or_update_user.py | Bension/osroom | 59148fbaf6068dd700a7f9dfb8e8a6882c2a5e67 | [
"BSD-2-Clause"
] | 50 | 2017-07-26T16:44:01.000Z | 2022-01-13T00:42:09.000Z | apps/modules/user/process/get_or_update_user.py | Bension/osroom | 59148fbaf6068dd700a7f9dfb8e8a6882c2a5e67 | [
"BSD-2-Clause"
] | 238 | 2018-05-19T17:31:19.000Z | 2022-01-09T08:19:04.000Z | #!/usr/bin/env python
# -*-coding:utf-8-*-
# @Time : 2017/11/1 ~ 2019/9/1
# @Author : Allen Woo
from bson import ObjectId
from apps.app import cache, mdbs
@cache.cached(timeout=7200, key_base64=False, db_type="redis")
def get_one_user(user_id=None, username=None, email=None, mphone_num=None):
"""
获取一个user, 单... | 22.766423 | 78 | 0.544405 |
cfd2ac2c02544a3e2fd541c2f581bee317a7dd3d | 1,703 | py | Python | tests/tools/test_pyupgrade.py | caioariede/nbQA | bb8baf47e4b0b431628edf28b1008397edb936a3 | [
"MIT"
] | null | null | null | tests/tools/test_pyupgrade.py | caioariede/nbQA | bb8baf47e4b0b431628edf28b1008397edb936a3 | [
"MIT"
] | null | null | null | tests/tools/test_pyupgrade.py | caioariede/nbQA | bb8baf47e4b0b431628edf28b1008397edb936a3 | [
"MIT"
] | null | null | null | """Check pyupgrade works."""
import difflib
import os
from pathlib import Path
from textwrap import dedent
from typing import TYPE_CHECKING
import pytest
from nbqa.__main__ import main
if TYPE_CHECKING:
from _pytest.capture import CaptureFixture
def test_pyupgrade(tmp_notebook_for_testing: Path, capsys: "Cap... | 26.2 | 88 | 0.615972 |
5f3b756d172aae4045876c9aaf16633e203ac269 | 30,568 | py | Python | python/mxnet/contrib/onnx/onnx2mx/_op_translations.py | lostella/incubator-mxnet | 213ab09e7a2924da436c0d0526d62fefeeea6aa7 | [
"Apache-2.0"
] | 28 | 2018-02-02T05:00:16.000Z | 2022-01-02T18:27:39.000Z | python/mxnet/contrib/onnx/onnx2mx/_op_translations.py | lostella/incubator-mxnet | 213ab09e7a2924da436c0d0526d62fefeeea6aa7 | [
"Apache-2.0"
] | 9 | 2017-09-19T01:30:36.000Z | 2017-09-25T23:35:41.000Z | python/mxnet/contrib/onnx/onnx2mx/_op_translations.py | lostella/incubator-mxnet | 213ab09e7a2924da436c0d0526d62fefeeea6aa7 | [
"Apache-2.0"
] | 1 | 2020-07-02T08:04:01.000Z | 2020-07-02T08:04:01.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 44.237337 | 99 | 0.620355 |
6479064e3677daa01e330eedd50f06b1667df8e2 | 18,081 | py | Python | build.py | plotdevice/plotdevice-manual | 278f42aa23f3081ddbe8bfb7a5e42adee6f8e54d | [
"MIT"
] | 1 | 2015-08-26T13:28:43.000Z | 2015-08-26T13:28:43.000Z | build.py | plotdevice/plotdevice-manual | 278f42aa23f3081ddbe8bfb7a5e42adee6f8e54d | [
"MIT"
] | null | null | null | build.py | plotdevice/plotdevice-manual | 278f42aa23f3081ddbe8bfb7a5e42adee6f8e54d | [
"MIT"
] | null | null | null | #!./env/bin/python
# encoding: utf-8
"""
build.py
Generate the PlotDevice Manual.
Created by Christian Swinehart on 2014/01/14.
Copyright (c) 2014 Samizdat Drafting Co. All rights reserved.
"""
from __future__ import with_statement, division
import sys, os, re
import json
from os.path import basename, abspath, dirna... | 35.245614 | 396 | 0.627233 |
f758c812b2de52a52e992a1798de379a959b6b41 | 2,235 | py | Python | demoDay25_CNNAndWord2Vec/boston_multi.py | mozhumz/machine_learning_py | 880f6778ac16b0a16a80b31972a35304caa91dc1 | [
"MulanPSL-1.0"
] | null | null | null | demoDay25_CNNAndWord2Vec/boston_multi.py | mozhumz/machine_learning_py | 880f6778ac16b0a16a80b31972a35304caa91dc1 | [
"MulanPSL-1.0"
] | null | null | null | demoDay25_CNNAndWord2Vec/boston_multi.py | mozhumz/machine_learning_py | 880f6778ac16b0a16a80b31972a35304caa91dc1 | [
"MulanPSL-1.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
#加载数据集
boston_housing = tf.keras.datasets.boston_housing
(train_x,train_y),(test_x,test_y) = boston_housing.load_data()
num_train=len(train_x) #训练集和测试机中样本的数量
num_test=len(test_x)
#对训练样本和测试样本进行标准化(归一化),这里有用到张量的广播运算机制
x_train=(train_x-train_x... | 26.294118 | 79 | 0.717673 |
6f97cb939223a8c2284341c284acf5e4281aae80 | 285 | py | Python | mathly/linalg/error.py | bangyen/mathly | efbd40cf1972fd7e9685ca0e1cda1ddacf77bf59 | [
"MIT"
] | 1 | 2020-05-02T00:14:54.000Z | 2020-05-02T00:14:54.000Z | mathly/linalg/error.py | bangyen/mathly | efbd40cf1972fd7e9685ca0e1cda1ddacf77bf59 | [
"MIT"
] | null | null | null | mathly/linalg/error.py | bangyen/mathly | efbd40cf1972fd7e9685ca0e1cda1ddacf77bf59 | [
"MIT"
] | 2 | 2020-04-27T23:05:30.000Z | 2020-07-06T20:19:15.000Z | __error__ = ["BaseError", "MatrixError", "VectorError"]
class BaseError(Exception):
pass
class MatrixError(BaseError):
pass
class VectorError(BaseError):
pass
class MathlyAssertError(AssertionError):
pass
# class MathlyModuleError(ModuleNotFoundError):
# pass
| 16.764706 | 55 | 0.736842 |
118ef5c447151559821ad3fe6a1f0e7b632c1c8d | 942 | py | Python | setup.py | robot2051/dto-digitalmarketplace-utils | e581be6396c12473697398b0ec9d253c564a324b | [
"MIT"
] | null | null | null | setup.py | robot2051/dto-digitalmarketplace-utils | e581be6396c12473697398b0ec9d253c564a324b | [
"MIT"
] | null | null | null | setup.py | robot2051/dto-digitalmarketplace-utils | e581be6396c12473697398b0ec9d253c564a324b | [
"MIT"
] | null | null | null | """
Common utils for Digital Marketplace apps.
"""
import re
import ast
import pip.download
from pip.req import parse_requirements
from setuptools import setup, find_packages
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('dmutils/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_r... | 27.705882 | 74 | 0.701699 |
0ff01cdab570c50850612969fcc84298d5db8402 | 9,668 | py | Python | timeflux/nodes/epoch.py | jonathanjfshaw/timeflux | a17100bce754bd6d85d2c9c65a95bfcc0e7fe219 | [
"MIT"
] | null | null | null | timeflux/nodes/epoch.py | jonathanjfshaw/timeflux | a17100bce754bd6d85d2c9c65a95bfcc0e7fe219 | [
"MIT"
] | null | null | null | timeflux/nodes/epoch.py | jonathanjfshaw/timeflux | a17100bce754bd6d85d2c9c65a95bfcc0e7fe219 | [
"MIT"
] | null | null | null | """Epoching nodes"""
import numpy as np
import pandas as pd
import json
import xarray as xr
from timeflux.core.node import Node
from timeflux.core.exceptions import WorkerInterrupt
from timeflux.helpers.port import match_events
class Epoch(Node):
""" Event-triggered epoching.
This node continuously buffers ... | 43.160714 | 240 | 0.538271 |
9d3fccc311643a44884280ae4bb4f14d3b681fe5 | 4,122 | py | Python | python/examples/leds.py | markkleeb/raspberrypi-ws2812 | 5c8175325773e5b5bad9c9d1b740a4ef144ae979 | [
"BSD-2-Clause"
] | 8 | 2018-03-19T21:38:09.000Z | 2021-04-21T20:46:44.000Z | python/examples/leds.py | markkleeb/raspberrypi-ws2812 | 5c8175325773e5b5bad9c9d1b740a4ef144ae979 | [
"BSD-2-Clause"
] | null | null | null | python/examples/leds.py | markkleeb/raspberrypi-ws2812 | 5c8175325773e5b5bad9c9d1b740a4ef144ae979 | [
"BSD-2-Clause"
] | 2 | 2018-06-29T19:09:43.000Z | 2021-11-17T23:00:31.000Z | # NeoPixel library strandtest example
# Author: Tony DiCola (tony@tonydicola.com)
#
# Direct port of the Arduino NeoPixel library strandtest example. Showcases
# various animations on a strip of NeoPixels.
import time, threading
from time import sleep
#------sudo pip install pyOSC------------#
import OSC
from neopixel... | 28.040816 | 121 | 0.629549 |
d82d6c3c8e1cbf03dc1da54366b07a036d54a3cf | 6,827 | py | Python | code/Experiments/BinaryNet-master/Train-time/mnist.py | matthijsvk/convNets | 7e65db7857a4e6abfbcab264953eb7741319de6c | [
"Apache-2.0"
] | 53 | 2017-04-18T10:06:20.000Z | 2021-12-29T21:26:07.000Z | code/Experiments/BinaryNet-master/Train-time/mnist.py | matthijsvk/convNets | 7e65db7857a4e6abfbcab264953eb7741319de6c | [
"Apache-2.0"
] | null | null | null | code/Experiments/BinaryNet-master/Train-time/mnist.py | matthijsvk/convNets | 7e65db7857a4e6abfbcab264953eb7741319de6c | [
"Apache-2.0"
] | 20 | 2017-05-03T03:27:09.000Z | 2022-03-24T07:07:45.000Z | from __future__ import print_function
import numpy as np
np.random.seed(1234) # for reproducibility
# specifying the gpu to use
# import theano.sandbox.cuda
# theano.sandbox.cuda.use('gpu1')
import theano
import theano.tensor as T
import lasagne
import binary_net
from pylearn2.datasets.mnist impor... | 32.980676 | 131 | 0.59001 |
31d515a221b68c90f7ce259d39bba861ab9298a6 | 3,180 | py | Python | peas/cmds/netspace_funcs.py | 13thProgression/peas-blockchain | 8e058cbfe0c1ab73f7c1ec41bedb39071c63141c | [
"Apache-2.0"
] | 2 | 2021-08-16T17:45:07.000Z | 2021-09-18T19:00:58.000Z | peas/cmds/netspace_funcs.py | 13thProgression/peas-blockchain | 8e058cbfe0c1ab73f7c1ec41bedb39071c63141c | [
"Apache-2.0"
] | 4 | 2021-09-26T15:50:20.000Z | 2021-10-06T06:18:51.000Z | peas/cmds/netspace_funcs.py | 13thProgression/peas-blockchain | 8e058cbfe0c1ab73f7c1ec41bedb39071c63141c | [
"Apache-2.0"
] | 3 | 2021-09-29T19:08:41.000Z | 2022-03-15T08:47:28.000Z | from typing import Optional
import aiohttp
from peas.rpc.full_node_rpc_client import FullNodeRpcClient
from peas.util.byte_types import hexstr_to_bytes
from peas.util.config import load_config
from peas.util.default_root import DEFAULT_ROOT_PATH
from peas.util.ints import uint16
from peas.util.misc import format_byte... | 42.4 | 107 | 0.614151 |
e4051326a13e8fa53cd580ab7dc11b7043cac3e9 | 98 | py | Python | tests/cases/run/comparison3.py | 3e45/minpiler | 993bdb38d1e4709a412bb551f7eb213376bfe7d2 | [
"MIT"
] | null | null | null | tests/cases/run/comparison3.py | 3e45/minpiler | 993bdb38d1e4709a412bb551f7eb213376bfe7d2 | [
"MIT"
] | 5 | 2022-02-12T19:53:08.000Z | 2022-03-02T04:30:32.000Z | tests/cases/run/comparison3.py | 3e45/minpiler | 993bdb38d1e4709a412bb551f7eb213376bfe7d2 | [
"MIT"
] | null | null | null | from minpiler.std import M, emulator
M.print(1 < 3 < 5, ";", 1 < 3 < 0)
emulator.kill()
# > 1;0
| 14 | 36 | 0.571429 |
e8ceb0fa99899906496120b84c516aadd1439488 | 1,372 | py | Python | CouncilTag/ingest/tests.py | hungrymonkey/engage-backend | 4d2bebb62487e0c3b6b29b6e6f9bfb06336c6973 | [
"Apache-2.0"
] | 1 | 2019-04-02T01:12:58.000Z | 2019-04-02T01:12:58.000Z | CouncilTag/ingest/tests.py | joshbeme/engage-backend | c7bade53d9371ce8375d2aa739aa1ca690e1ba68 | [
"Apache-2.0"
] | null | null | null | CouncilTag/ingest/tests.py | joshbeme/engage-backend | c7bade53d9371ce8375d2aa739aa1ca690e1ba68 | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase
from CouncilTag.ingest.tagging import TagEngine, RandomTagEngine
from CouncilTag.ingest.models import Committee, Agenda, AgendaItem, Tag
from datetime import datetime
import calendar
class TestTaggingInterface(TestCase):
def test_not_implementation(self):
class TestTa... | 34.3 | 86 | 0.683673 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.