hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | 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 4 247 | max_forks_repo_name stringlengths 4 125 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a2f4a4c5e5b6b5f7af2cd00be9ce28ffe2b40bd4 | 1,033 | py | Python | idact/detail/jupyter_app/format_allocation_parameters.py | intdata-bsc/idact | 54cb65a711c145351e205970c27c83e6393cccf5 | [
"MIT"
] | 5 | 2018-12-06T15:40:34.000Z | 2019-06-19T11:22:58.000Z | idact/detail/jupyter_app/format_allocation_parameters.py | garstka/idact | b9c8405c94db362c4a51d6bfdf418b14f06f0da1 | [
"MIT"
] | 9 | 2018-12-06T16:35:26.000Z | 2019-04-28T19:01:40.000Z | idact/detail/jupyter_app/format_allocation_parameters.py | intdata-bsc/idact | 54cb65a711c145351e205970c27c83e6393cccf5 | [
"MIT"
] | 2 | 2019-04-28T19:18:58.000Z | 2019-06-17T06:56:28.000Z | from idact.detail.jupyter_app.app_allocation_parameters import \
AppAllocationParameters
def format_allocation_parameters(parameters: AppAllocationParameters):
"""Formats allocation parameters for the user.
:param parameters: Parameters to print.
"""
result = "Allocation parameters:\n"
r... | 36.892857 | 76 | 0.599226 | from idact.detail.jupyter_app.app_allocation_parameters import \
AppAllocationParameters
def format_allocation_parameters(parameters: AppAllocationParameters):
"""Formats allocation parameters for the user.
:param parameters: Parameters to print.
"""
result = "Allocation parameters:\n"
r... | 0 | 0 | 0 |
1a448cb755aa154c4d1cb00784d3534f5b118245 | 1,372 | py | Python | scripts/create-service.py | MdbookTech/blueteam-scripts | cb275554889c11558eb8a34da1f10e48d35a40c3 | [
"MIT"
] | 2 | 2022-03-05T19:32:14.000Z | 2022-03-06T01:39:05.000Z | scripts/create-service.py | MdbookTech/blueteam-scripts | cb275554889c11558eb8a34da1f10e48d35a40c3 | [
"MIT"
] | 1 | 2022-03-05T15:12:37.000Z | 2022-03-29T12:44:40.000Z | scripts/create-service.py | MdbookTech/blueteam-scripts | cb275554889c11558eb8a34da1f10e48d35a40c3 | [
"MIT"
] | 1 | 2022-03-05T15:07:17.000Z | 2022-03-05T15:07:17.000Z | #!/usr/bin/env python3
import os, sys
service = "[Unit]\n"\
"Description={description}\n"\
"After=network.target\n"\
"StartLimitIntervalSec=0\n"\
"\n"\
"[Service]\n"\
"Type=simple\n"\
"Restart=always\n"\
"RestartSec=1\n"\
"User=root\n"\
"ExecStart={exec}\n"\
"\n"\
"[Install]\n"\
"WantedBy=multi-user.target"
name = Fa... | 25.407407 | 110 | 0.607143 | #!/usr/bin/env python3
import os, sys
service = "[Unit]\n"\
"Description={description}\n"\
"After=network.target\n"\
"StartLimitIntervalSec=0\n"\
"\n"\
"[Service]\n"\
"Type=simple\n"\
"Restart=always\n"\
"RestartSec=1\n"\
"User=root\n"\
"ExecStart={exec}\n"\
"\n"\
"[Install]\n"\
"WantedBy=multi-user.target"
name = Fa... | 0 | 0 | 0 |
99a9a4abe4c42ed816e13282afa86541789f36d3 | 339 | py | Python | backend/api/app/models/core.py | jhouser/houseoffun | a5a9dab377864d4da15f7ba64b505d2db3af34ef | [
"MIT"
] | null | null | null | backend/api/app/models/core.py | jhouser/houseoffun | a5a9dab377864d4da15f7ba64b505d2db3af34ef | [
"MIT"
] | 3 | 2018-03-31T09:52:03.000Z | 2018-08-16T18:12:51.000Z | backend/api/app/models/core.py | jhouser/houseoffun | a5a9dab377864d4da15f7ba64b505d2db3af34ef | [
"MIT"
] | 1 | 2018-03-21T16:05:36.000Z | 2018-03-21T16:05:36.000Z | from django.db import models
| 24.214286 | 56 | 0.672566 | from django.db import models
class Plugin(models.Model):
def __str__(self):
"""
Returns the string representation of the object
"""
return self.name
name = models.CharField(max_length=100, unique=True)
description = models.TextField()
default_enabled = models.BooleanFi... | 0 | 286 | 23 |
5ac718a9a3a5fee2747799e46eb931885e69b9b1 | 15,896 | py | Python | serving/processor/tests/flatbuf_test/python/perf.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 292 | 2021-12-24T03:24:33.000Z | 2022-03-31T15:41:05.000Z | serving/processor/tests/flatbuf_test/python/perf.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 54 | 2021-12-24T06:40:09.000Z | 2022-03-30T07:57:24.000Z | serving/processor/tests/flatbuf_test/python/perf.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 75 | 2021-12-24T04:48:21.000Z | 2022-03-29T10:13:39.000Z | #!/usr/bin/python
import string
import random
import array
from copy import copy, deepcopy
import time
import numpy as np
import flatbuffers
import eas.FloatContentType as FloatContentType
import eas.ContentType as ContentType
import eas.ShapeType as ShapeType
import eas.Int64ContentType as Int64ContentType
import eas... | 32.842975 | 95 | 0.705398 | #!/usr/bin/python
import string
import random
import array
from copy import copy, deepcopy
import time
import numpy as np
import flatbuffers
import eas.FloatContentType as FloatContentType
import eas.ContentType as ContentType
import eas.ShapeType as ShapeType
import eas.Int64ContentType as Int64ContentType
import eas... | 15,288 | 0 | 46 |
1c55738b9325d8c335826e09a8b45b1161b3b1c0 | 1,335 | py | Python | pikarpc/rpc_server.py | valfrom/python_pika_rpc | 6de04e4bd47cf2322d8d28938586608a32420fe4 | [
"MIT"
] | null | null | null | pikarpc/rpc_server.py | valfrom/python_pika_rpc | 6de04e4bd47cf2322d8d28938586608a32420fe4 | [
"MIT"
] | null | null | null | pikarpc/rpc_server.py | valfrom/python_pika_rpc | 6de04e4bd47cf2322d8d28938586608a32420fe4 | [
"MIT"
] | null | null | null | import requests
from .chunked_utils import chunked_bytes_from_object, chunked_object_from_bytes
| 37.083333 | 104 | 0.586517 | import requests
from .chunked_utils import chunked_bytes_from_object, chunked_object_from_bytes
class RpcServer:
def __init__(self, queue_name='rpc_queue', host='localhost', port=8001, timeout=120):
self.queue_name = queue_name
self.host = host
self.port = port
self.timeout = timeo... | 1,113 | -5 | 130 |
9241d1ed5e2184bd5413c63c3163de0865cdf4f2 | 2,272 | py | Python | TSSR/Blocks.py | cestcedric/TSSR-GAN | d6e1b50409e0f0591660552993e6d5b70d41e766 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | TSSR/Blocks.py | cestcedric/TSSR-GAN | d6e1b50409e0f0591660552993e6d5b70d41e766 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | TSSR/Blocks.py | cestcedric/TSSR-GAN | d6e1b50409e0f0591660552993e6d5b70d41e766 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from utils import tools
| 22.949495 | 57 | 0.510563 | import torch
import torch.nn as nn
from utils import tools
class Basic(nn.Module):
def __init__(self,
in_channels,
out_channels,
kernel_size,
stride,
padding
):
super(Basic, self).__init__()
self.conv = nn.Conv2d(
in_channels = in... | 1,974 | 8 | 228 |
2b7da2d649e5c613d223dc135c5af32c5f4490b3 | 360 | py | Python | laa_court_data_api_app/models/hearing_events/hearing_events_result.py | ministryofjustice/laa-court-data-api | 2e79faac7469f0b31ecca0539906d281db08f86c | [
"MIT"
] | 1 | 2022-01-27T14:28:40.000Z | 2022-01-27T14:28:40.000Z | laa_court_data_api_app/models/hearing_events/hearing_events_result.py | ministryofjustice/laa-court-data-api | 2e79faac7469f0b31ecca0539906d281db08f86c | [
"MIT"
] | 16 | 2022-01-28T11:01:27.000Z | 2022-03-30T14:01:11.000Z | laa_court_data_api_app/models/hearing_events/hearing_events_result.py | ministryofjustice/laa-court-data-api | 2e79faac7469f0b31ecca0539906d281db08f86c | [
"MIT"
] | null | null | null | from typing import Optional
from uuid import UUID
from pydantic import BaseModel
from laa_court_data_api_app.models.hearing_events.hearing_event.result.hearing_event import HearingEvent
| 27.692308 | 104 | 0.811111 | from typing import Optional
from uuid import UUID
from pydantic import BaseModel
from laa_court_data_api_app.models.hearing_events.hearing_event.result.hearing_event import HearingEvent
class HearingEventsResult(BaseModel):
hearing_id: Optional[UUID] = None
has_active_hearing: Optional[bool] = None
even... | 0 | 148 | 23 |
42a5018ca0edc0d33e20853d979b889179fe01ed | 1,878 | py | Python | platform/core/polyaxon/signals/experiment_groups.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/polyaxon/signals/experiment_groups.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/polyaxon/signals/experiment_groups.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | from hestia.signal_decorators import ignore_raw, ignore_updates, ignore_updates_pre
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from constants.backends import NATIVE_BACKEND
from db.models.experiment_groups import ExperimentGroup, GroupTypes
from libs.repos.utils impo... | 38.326531 | 85 | 0.7918 | from hestia.signal_decorators import ignore_raw, ignore_updates, ignore_updates_pre
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from constants.backends import NATIVE_BACKEND
from db.models.experiment_groups import ExperimentGroup, GroupTypes
from libs.repos.utils impo... | 995 | 0 | 44 |
80d85a99a4a51f6c6692c8f763e442f48d7ca665 | 3,356 | py | Python | UQuant/mcmc.py | hajians/UQ | bfab2e2a1f3f410ef98792c151ae4b5d4a9aa340 | [
"BSD-2-Clause"
] | null | null | null | UQuant/mcmc.py | hajians/UQ | bfab2e2a1f3f410ef98792c151ae4b5d4a9aa340 | [
"BSD-2-Clause"
] | null | null | null | UQuant/mcmc.py | hajians/UQ | bfab2e2a1f3f410ef98792c151ae4b5d4a9aa340 | [
"BSD-2-Clause"
] | 1 | 2020-04-20T17:26:05.000Z | 2020-04-20T17:26:05.000Z | #! /usr/bin/env python2.7
from numpy import random
import time
# change the seed
random.seed(int(time.time()))
class MCMC(object):
'''
MCMC implements Markov-Chain-Monte-Carlo algorithms.
'''
def __init__(self, Density, Proposal, Drawing_func, initial):
'''
Initialize an MCMC algorit... | 25.815385 | 80 | 0.516091 | #! /usr/bin/env python2.7
from numpy import random
import time
# change the seed
random.seed(int(time.time()))
class MCMC(object):
'''
MCMC implements Markov-Chain-Monte-Carlo algorithms.
'''
def __init__(self, Density, Proposal, Drawing_func, initial):
'''
Initialize an MCMC algorit... | 0 | 0 | 0 |
ac4a24fecfc06baf9be1c09c88ccca8e734decae | 6,774 | py | Python | mdx_wikilink_plus/mdx_wikilink_plus.py | klml/mdx_wikilink_plus | f582b0006bf50e4e3ca9102a41cb395074879164 | [
"BSD-3-Clause"
] | null | null | null | mdx_wikilink_plus/mdx_wikilink_plus.py | klml/mdx_wikilink_plus | f582b0006bf50e4e3ca9102a41cb395074879164 | [
"BSD-3-Clause"
] | null | null | null | mdx_wikilink_plus/mdx_wikilink_plus.py | klml/mdx_wikilink_plus | f582b0006bf50e4e3ca9102a41cb395074879164 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
'''
WikiLinkPlus Extension for Python-Markdown
===========================================
Converts [[WikiLinks]] to relative links.
See <https://github.com/neurobin/mdx_wikilink_plus> for documentation.
Copyright Md. Jahidul Hamid <jahidulhamid@yahoo.com>
License: [BSD](http://www.opensourc... | 35.098446 | 146 | 0.563478 | # -*- coding: utf-8 -*-
'''
WikiLinkPlus Extension for Python-Markdown
===========================================
Converts [[WikiLinks]] to relative links.
See <https://github.com/neurobin/mdx_wikilink_plus> for documentation.
Copyright Md. Jahidul Hamid <jahidulhamid@yahoo.com>
License: [BSD](http://www.opensourc... | 1,392 | 2,436 | 100 |
a67a0cc45ae2c7b7de0997634b2c667c10ddb122 | 11,921 | py | Python | modules/room.py | jaquinocode/the-room | cdff3772acb8fea2b8920a179be59ae3fe9b607b | [
"MIT"
] | null | null | null | modules/room.py | jaquinocode/the-room | cdff3772acb8fea2b8920a179be59ae3fe9b607b | [
"MIT"
] | null | null | null | modules/room.py | jaquinocode/the-room | cdff3772acb8fea2b8920a179be59ae3fe9b607b | [
"MIT"
] | null | null | null |
"""
self.all_things = {
"room_1": {
"room": {
"look": (
"You can see a bed and a desk with a phone resting on top. "
"There's nothing else."
),
"pickup": "Don't be ridiculous.",
"approach": "You're already in the room, man. No... | 37.487421 | 88 | 0.42941 | class Room:
def __init__(self):
self.room_number = 0
self.room_things = {
"room": {
"look": "A room.",
"pickup": "Don't be ridiculous.",
"approach": "You're already in the room, man. No need.",
"hit": "You kick and hit aroun... | 2,714 | -13 | 124 |
3842683c2243849d3dec1f065f947ba6da2cf2c7 | 9,847 | py | Python | plaso/output/mysql_4n6time.py | infosecjosh/plaso | 7b5fc33591c60e89afc231a451449d40e02d8985 | [
"Apache-2.0"
] | null | null | null | plaso/output/mysql_4n6time.py | infosecjosh/plaso | 7b5fc33591c60e89afc231a451449d40e02d8985 | [
"Apache-2.0"
] | null | null | null | plaso/output/mysql_4n6time.py | infosecjosh/plaso | 7b5fc33591c60e89afc231a451449d40e02d8985 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Defines the output module for the MySQL database used by 4n6time."""
from __future__ import unicode_literals
try:
import MySQLdb
except ImportError:
MySQLdb = None
from plaso.output import logger
from plaso.output import manager
from plaso.output import shared_4n6time
class MySQL4n6T... | 33.607509 | 78 | 0.654006 | # -*- coding: utf-8 -*-
"""Defines the output module for the MySQL database used by 4n6time."""
from __future__ import unicode_literals
try:
import MySQLdb
except ImportError:
MySQLdb = None
from plaso.output import logger
from plaso.output import manager
from plaso.output import shared_4n6time
class MySQL4n6T... | 0 | 0 | 0 |
5de6236dd0699f1268c0cc7dde26930b8677b4cb | 6,758 | py | Python | irclib/irclib.py | dkovar/ircollect | c2cff0b843a80b18e38d6b3f1551f81a4f34d1bc | [
"Apache-2.0"
] | 21 | 2015-02-01T12:07:46.000Z | 2021-08-16T14:08:10.000Z | irclib/irclib.py | dkovar/ircollect | c2cff0b843a80b18e38d6b3f1551f81a4f34d1bc | [
"Apache-2.0"
] | null | null | null | irclib/irclib.py | dkovar/ircollect | c2cff0b843a80b18e38d6b3f1551f81a4f34d1bc | [
"Apache-2.0"
] | 9 | 2015-06-06T03:55:33.000Z | 2021-05-20T02:53:35.000Z | #!/usr/bin/env python
# Author: David Kovar [dkovar <at> gmail [dot] com]
# Name: analyzeMFT.py
#
# Copyright (c) 2010 David Kovar. All rights reserved.
# This software is distributed under the Common Public License 1.0
#
# Date: May 2013
#
import sys
import os
import struct
import mbr_parser
from analyzemft import ... | 35.756614 | 181 | 0.533442 | #!/usr/bin/env python
# Author: David Kovar [dkovar <at> gmail [dot] com]
# Name: analyzeMFT.py
#
# Copyright (c) 2010 David Kovar. All rights reserved.
# This software is distributed under the Common Public License 1.0
#
# Date: May 2013
#
import sys
import os
import struct
import mbr_parser
from analyzemft import ... | 5,987 | 0 | 308 |
0997a58e0b7008344301a384104eb6d0cced30f8 | 25,264 | py | Python | SampleTimeSeries/Covid-19 India Pred/Trigger_Final(Covid).py | skpraks/AutoBrewML | 9f6386f439e30bf1dc11026b3ca3acbb792a76a5 | [
"MIT"
] | 5 | 2021-11-16T16:16:49.000Z | 2022-03-17T10:21:48.000Z | SampleTimeSeries/Covid-19 India Pred/Trigger_Final(Covid).py | skpraks/AutoBrewML | 9f6386f439e30bf1dc11026b3ca3acbb792a76a5 | [
"MIT"
] | null | null | null | SampleTimeSeries/Covid-19 India Pred/Trigger_Final(Covid).py | skpraks/AutoBrewML | 9f6386f439e30bf1dc11026b3ca3acbb792a76a5 | [
"MIT"
] | 3 | 2021-09-15T01:40:48.000Z | 2021-09-28T19:26:37.000Z | # Databricks notebook source
# MAGIC %md
# MAGIC **PROBLEM STATEMENT**
# MAGIC <br/>Predict the Active Covid cases of 2021 depending on 2020 statewise data in India.
# MAGIC <br/>Get Sample data from Source- https://www.kaggle.com/aritranandi23/covid-19-analysis-and-prediction/data
# MAGIC <br/>
# MAGIC <br/>**COLUMN ... | 39.108359 | 407 | 0.712397 | # Databricks notebook source
# MAGIC %md
# MAGIC **PROBLEM STATEMENT**
# MAGIC <br/>Predict the Active Covid cases of 2021 depending on 2020 statewise data in India.
# MAGIC <br/>Get Sample data from Source- https://www.kaggle.com/aritranandi23/covid-19-analysis-and-prediction/data
# MAGIC <br/>
# MAGIC <br/>**COLUMN ... | 6,559 | 0 | 22 |
a89753c445bc75fec82c992f97321cccb4450c4f | 1,618 | py | Python | website/managers.py | czhu1217/cmimc-online | 5ef49ceec0bb86d8ae120a6ecfd723532e277821 | [
"MIT"
] | null | null | null | website/managers.py | czhu1217/cmimc-online | 5ef49ceec0bb86d8ae120a6ecfd723532e277821 | [
"MIT"
] | 1 | 2022-01-23T21:08:12.000Z | 2022-01-23T21:08:12.000Z | website/managers.py | czhu1217/cmimc-online | 5ef49ceec0bb86d8ae120a6ecfd723532e277821 | [
"MIT"
] | 1 | 2021-10-17T17:11:42.000Z | 2021-10-17T17:11:42.000Z | from django.contrib.auth.base_user import BaseUserManager
from django.utils.translation import ugettext_lazy as _
from django.db import models
from website.utils import log
| 40.45 | 93 | 0.6644 | from django.contrib.auth.base_user import BaseUserManager
from django.utils.translation import ugettext_lazy as _
from django.db import models
from website.utils import log
class UserManager(BaseUserManager):
def create_user(self, email, password, **extra_fields):
print("creating user")
if not ema... | 1,286 | 33 | 125 |
715945f6bfdac5d5523bceb60ecc78a8286f3368 | 60,936 | py | Python | gausspyplus/gausspy_py3/gp_plus.py | cmurray-astro/gausspyplus | bb26e561da70b8b130c785fbc4324c95bc416766 | [
"BSD-3-Clause"
] | 34 | 2019-06-03T14:03:28.000Z | 2022-02-02T16:25:23.000Z | gausspyplus/gausspy_py3/gp_plus.py | cmurray-astro/gausspyplus | bb26e561da70b8b130c785fbc4324c95bc416766 | [
"BSD-3-Clause"
] | 4 | 2020-03-13T06:35:58.000Z | 2021-04-06T07:06:23.000Z | gausspyplus/gausspy_py3/gp_plus.py | cmurray-astro/gausspyplus | bb26e561da70b8b130c785fbc4324c95bc416766 | [
"BSD-3-Clause"
] | 8 | 2019-06-26T01:48:28.000Z | 2021-11-20T23:54:07.000Z | # @Author: riener
# @Date: 2018-12-19T17:30:53+01:00
# @Filename: gp_plus.py
# @Last modified by: riener
# @Last modified time: 2019-04-08T10:20:37+02:00
import itertools
import sys
import numpy as np
import lmfit
from lmfit import minimize as lmfit_minimize
from lmfit import Parameters
from gausspyplus.utils.de... | 43.217021 | 349 | 0.674724 | # @Author: riener
# @Date: 2018-12-19T17:30:53+01:00
# @Filename: gp_plus.py
# @Last modified by: riener
# @Last modified time: 2019-04-08T10:20:37+02:00
import itertools
import sys
import numpy as np
import lmfit
from lmfit import minimize as lmfit_minimize
from lmfit import Parameters
from gausspyplus.utils.de... | 1,741 | 0 | 23 |
72c0869aabb83d56121232950cd70ef62d636012 | 7,854 | py | Python | src/python/pants/task/testrunner_task_mixin.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | src/python/pants/task/testrunner_task_mixin.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | src/python/pants/task/testrunner_task_mixin.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from abc import abst... | 42 | 113 | 0.717341 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from abc import abst... | 1,846 | 0 | 73 |
b495ac0c80aefeac61c6e29f2746ccb58239b881 | 2,409 | py | Python | cloudmesh/analytics/Request.py | cloudmesh/cloudmesh-analytics | 26e8ab8e718730cbbc5b99ac71395c22686ae698 | [
"Apache-2.0"
] | null | null | null | cloudmesh/analytics/Request.py | cloudmesh/cloudmesh-analytics | 26e8ab8e718730cbbc5b99ac71395c22686ae698 | [
"Apache-2.0"
] | null | null | null | cloudmesh/analytics/Request.py | cloudmesh/cloudmesh-analytics | 26e8ab8e718730cbbc5b99ac71395c22686ae698 | [
"Apache-2.0"
] | 2 | 2019-10-21T03:58:57.000Z | 2020-02-12T00:07:06.000Z | import json
import requests
import webbrowser
| 27.375 | 74 | 0.577003 | import json
import requests
import webbrowser
class Request(object):
@staticmethod
def _post(url, payload, verbose=False):
if verbose:
print("Contacting:", url)
print("payload:", payload)
r = requests.post(url, json=payload)
return r
@staticmethod
def u... | 1,932 | 407 | 23 |
a8563cb35d7d411b78841fc0cdb92db497ab6af8 | 11,657 | py | Python | pytorch3dunet/datasets/sxth.py | charmsoya/pytorch-3dunet | 07a8dabf988ac3df110a3c10db6ed5fb769498d9 | [
"MIT"
] | null | null | null | pytorch3dunet/datasets/sxth.py | charmsoya/pytorch-3dunet | 07a8dabf988ac3df110a3c10db6ed5fb769498d9 | [
"MIT"
] | null | null | null | pytorch3dunet/datasets/sxth.py | charmsoya/pytorch-3dunet | 07a8dabf988ac3df110a3c10db6ed5fb769498d9 | [
"MIT"
] | null | null | null | import os
from pathlib import Path
import imageio
import numpy as np
import SimpleITK as sitk
import h5py
from pytorch3dunet.augment import transforms
from pytorch3dunet.datasets.utils import ConfigDataset, calculate_stats
from pytorch3dunet.unet3d.utils import get_logger, expand_as_one_hot
from pytorch3dunet.dataset... | 43.334572 | 119 | 0.599211 | import os
from pathlib import Path
import imageio
import numpy as np
import SimpleITK as sitk
import h5py
from pytorch3dunet.augment import transforms
from pytorch3dunet.datasets.utils import ConfigDataset, calculate_stats
from pytorch3dunet.unet3d.utils import get_logger, expand_as_one_hot
from pytorch3dunet.dataset... | 10,660 | 363 | 164 |
7dca8bf264229ab88732e69f8b1699058151e4d4 | 25,443 | py | Python | sdk/python/pulumi_google_native/memcache/v1/instance.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/memcache/v1/instance.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/memcache/v1/instance.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 51.504049 | 466 | 0.673899 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 5,168 | 19,784 | 45 |
ca7e906108b282f07fe944a3324ababaf1732769 | 1,813 | py | Python | pokr/widgets/relation.py | minsukkahng/pokr.kr | 169475778c998b4198ac7d6a1cebbc3c389e41b8 | [
"Apache-2.0"
] | 76 | 2015-01-19T12:39:43.000Z | 2021-10-14T06:10:25.000Z | pokr/widgets/relation.py | minsukkahng/pokr.kr | 169475778c998b4198ac7d6a1cebbc3c389e41b8 | [
"Apache-2.0"
] | 22 | 2015-01-03T01:00:53.000Z | 2019-09-14T11:55:06.000Z | pokr/widgets/relation.py | minsukkahng/pokr.kr | 169475778c998b4198ac7d6a1cebbc3c389e41b8 | [
"Apache-2.0"
] | 28 | 2015-01-14T15:45:00.000Z | 2020-06-03T13:29:41.000Z | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from itertools import izip
from flask import render_template
from flask.ext.babel import gettext
from sqlalchemy import Text
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.sql.expression import and_, cast, desc
from pokr.models.candi... | 32.963636 | 84 | 0.643685 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from itertools import izip
from flask import render_template
from flask.ext.babel import gettext
from sqlalchemy import Text
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.sql.expression import and_, cast, desc
from pokr.models.candi... | 1,351 | 0 | 46 |
9f3465d74493da47a708f7f71904bfcaa2055219 | 107 | py | Python | run.py | zhangweiii/idiom-game | 86b0e1b44014cb3776fb8d3d3c67a89b30c2adc5 | [
"MIT"
] | 1 | 2019-11-09T14:46:30.000Z | 2019-11-09T14:46:30.000Z | run.py | zhangweiii/idiom-game | 86b0e1b44014cb3776fb8d3d3c67a89b30c2adc5 | [
"MIT"
] | 2 | 2021-03-31T19:31:46.000Z | 2021-12-13T20:28:57.000Z | run.py | zhangweiii/idiom-game | 86b0e1b44014cb3776fb8d3d3c67a89b30c2adc5 | [
"MIT"
] | null | null | null | from game import Game
import sys
if __name__ == '__main__':
game = Game(sys.argv[1])
game.start()
| 15.285714 | 28 | 0.654206 | from game import Game
import sys
if __name__ == '__main__':
game = Game(sys.argv[1])
game.start()
| 0 | 0 | 0 |
64d7d75239c9546ee0d2f78aff147031a3527a1a | 1,407 | py | Python | bsp/intel/peripheral/libupm/examples/python/eboled.py | OpenSource-Infinix/android_hardware | 9a8a025f7c9471444c9e271bbe7f48182741d710 | [
"Unlicense"
] | 1 | 2017-09-22T01:41:30.000Z | 2017-09-22T01:41:30.000Z | bsp/intel/peripheral/libupm/examples/python/eboled.py | Keneral/ahardware | 9a8a025f7c9471444c9e271bbe7f48182741d710 | [
"Unlicense"
] | null | null | null | bsp/intel/peripheral/libupm/examples/python/eboled.py | Keneral/ahardware | 9a8a025f7c9471444c9e271bbe7f48182741d710 | [
"Unlicense"
] | 1 | 2018-02-24T19:09:04.000Z | 2018-02-24T19:09:04.000Z | #!/usr/bin/python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 l... | 34.317073 | 72 | 0.760483 | #!/usr/bin/python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 l... | 0 | 0 | 0 |
45216340d5b6b9e29a840efc81b1f4031cd59aaf | 3,677 | py | Python | extstats/templates.py | bakl/chrome-extensions-archive | e940c40368f04b97f52c03b045569768ead6760f | [
"MIT"
] | 408 | 2016-04-27T03:20:20.000Z | 2022-02-25T06:48:16.000Z | extstats/templates.py | bakl/chrome-extensions-archive | e940c40368f04b97f52c03b045569768ead6760f | [
"MIT"
] | 37 | 2016-04-27T07:55:57.000Z | 2022-02-13T09:25:56.000Z | extstats/templates.py | bakl/chrome-extensions-archive | e940c40368f04b97f52c03b045569768ead6760f | [
"MIT"
] | 79 | 2016-05-18T09:51:53.000Z | 2022-03-25T13:43:31.000Z | import datetime, json
from lys import L
VIEW_SOURCE_URL = "/source/crxviewer.html?crx="
| 31.698276 | 279 | 0.478651 | import datetime, json
from lys import L
VIEW_SOURCE_URL = "/source/crxviewer.html?crx="
def _add_commas(n):
return "{:,}".format(int(n))
def _sizeof_fmt(num):
for unit in ['', 'Ko', 'Mo', 'Go', 'To']:
if abs(num) < 1024.0:
return "%3.1f %s" % (num, unit)
num /= 1024.0
retur... | 3,396 | 0 | 184 |
40f57ff6c3b559cdd63356d9da59253176bb86ed | 12,748 | py | Python | ibllib/misc/exp_ref.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | 1 | 2020-11-21T07:02:21.000Z | 2020-11-21T07:02:21.000Z | ibllib/misc/exp_ref.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | null | null | null | ibllib/misc/exp_ref.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | null | null | null | """
A module for processing experiment references in a human readable way
Three pieces of information are required to uniquely identify an experimental session: subject
nickname, the date, and the sequence number (whether the session was the first, second,
etc. on that date).
Alyx and ONE use uuids (a.k.a. eids) to u... | 39.590062 | 99 | 0.632021 | """
A module for processing experiment references in a human readable way
Three pieces of information are required to uniquely identify an experimental session: subject
nickname, the date, and the sequence number (whether the session was the first, second,
etc. on that date).
Alyx and ONE use uuids (a.k.a. eids) to u... | 1,120 | 0 | 72 |
d4903f39e9f33a606e60380e866091010415115e | 1,467 | py | Python | pwndbg/commands/canary.py | dev2ero/pwndbg | dbaa3806fd462d4840cded98a155275ea58df7f8 | [
"MIT"
] | 4,461 | 2016-05-30T17:14:06.000Z | 2022-03-31T11:19:49.000Z | pwndbg/commands/canary.py | dev2ero/pwndbg | dbaa3806fd462d4840cded98a155275ea58df7f8 | [
"MIT"
] | 789 | 2016-05-27T21:17:52.000Z | 2022-03-31T12:37:06.000Z | pwndbg/commands/canary.py | dev2ero/pwndbg | dbaa3806fd462d4840cded98a155275ea58df7f8 | [
"MIT"
] | 844 | 2016-06-01T00:37:04.000Z | 2022-03-31T10:39:30.000Z | import pwndbg.auxv
import pwndbg.commands
import pwndbg.commands.telescope
import pwndbg.memory
import pwndbg.regs
import pwndbg.search
from pwndbg.color import message
@pwndbg.commands.ArgparsedCommand('Print out the current stack canary.')
@pwndbg.commands.OnlyWhenRunning
| 31.212766 | 101 | 0.716428 | import pwndbg.auxv
import pwndbg.commands
import pwndbg.commands.telescope
import pwndbg.memory
import pwndbg.regs
import pwndbg.search
from pwndbg.color import message
def canary_value():
auxv = pwndbg.auxv.get()
at_random = auxv.get('AT_RANDOM', None)
if at_random is None:
return None, None
... | 1,144 | 0 | 45 |
0732457243e69c5308d2afd177abd71459307b16 | 1,149 | py | Python | candphy/waves/plot.py | perseu912/candphy | e50fc29b1913e465a1473da0ef9d9a44239e2590 | [
"MIT"
] | null | null | null | candphy/waves/plot.py | perseu912/candphy | e50fc29b1913e465a1473da0ef9d9a44239e2590 | [
"MIT"
] | null | null | null | candphy/waves/plot.py | perseu912/candphy | e50fc29b1913e465a1473da0ef9d9a44239e2590 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from candphy.logs import log
#creating the def for plotting the signals wave | 33.794118 | 76 | 0.565709 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from candphy.logs import log
#creating the def for plotting the signals wave
def plot_signal(signal_radio,Fs=99.9,Fc=3.1,NFFT=1024,
style='science',xlabel='frequency (Mhz)',
ylabel='Power Spectral Density (D... | 970 | 0 | 22 |
9a8eb004418494f79079ba8323e2cdaf0da0d116 | 17,408 | py | Python | toolbox/scripts/CreateWeightTableFromECMWFRunoff.py | erdc-cm/python-toolbox-for-rapid | 702a606ef3b6f182e3fcf3ef9b14a94494270104 | [
"Apache-2.0"
] | 4 | 2018-01-24T18:16:40.000Z | 2021-07-07T03:41:26.000Z | toolbox/scripts/CreateWeightTableFromECMWFRunoff.py | erdc/python-toolbox-for-rapid | 702a606ef3b6f182e3fcf3ef9b14a94494270104 | [
"Apache-2.0"
] | null | null | null | toolbox/scripts/CreateWeightTableFromECMWFRunoff.py | erdc/python-toolbox-for-rapid | 702a606ef3b6f182e3fcf3ef9b14a94494270104 | [
"Apache-2.0"
] | 1 | 2016-06-17T14:58:29.000Z | 2016-06-17T14:58:29.000Z | '''-------------------------------------------------------------------------------
Tool Name: CreateWeightTableFromECMWFRunoff
Source Name: CreateWeightTableFromECMWFRunoff.py
Version: ArcGIS 10.2
License: Apache 2.0
Author: Environmental Systems Research Institute Inc.
Updated by: Environmental S... | 47.824176 | 130 | 0.572898 | '''-------------------------------------------------------------------------------
Tool Name: CreateWeightTableFromECMWFRunoff
Source Name: CreateWeightTableFromECMWFRunoff.py
Version: ArcGIS 10.2
License: Apache 2.0
Author: Environmental Systems Research Institute Inc.
Updated by: Environmental S... | 0 | 16,205 | 23 |
dc845ad716c26a7627f7aa65b7b809aa42e80bda | 363 | py | Python | core/urls.py | icakmak/Django-Rest-Framework-Telefon-Rehberi-Api | 4ceab98b34288f94cf8bd543f42c63b4d4ea06c5 | [
"MIT"
] | null | null | null | core/urls.py | icakmak/Django-Rest-Framework-Telefon-Rehberi-Api | 4ceab98b34288f94cf8bd543f42c63b4d4ea06c5 | [
"MIT"
] | null | null | null | core/urls.py | icakmak/Django-Rest-Framework-Telefon-Rehberi-Api | 4ceab98b34288f94cf8bd543f42c63b4d4ea06c5 | [
"MIT"
] | null | null | null |
from django.contrib import admin
from django.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path('api-auth/',include('rest_framework.urls')),
path('api/rest-auth/',include('rest_auth.urls')),
path('api/rest-auth/registration/',include('rest_auth.registration.urls')),
p... | 30.25 | 80 | 0.68595 |
from django.contrib import admin
from django.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path('api-auth/',include('rest_framework.urls')),
path('api/rest-auth/',include('rest_auth.urls')),
path('api/rest-auth/registration/',include('rest_auth.registration.urls')),
p... | 0 | 0 | 0 |
8b0ed4e3e3430c3c2b36aa291ae93bf2fb88e08d | 1,033 | py | Python | infra/services/git_cookie_daemon/__main__.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | 1 | 2020-11-11T06:25:13.000Z | 2020-11-11T06:25:13.000Z | infra/services/git_cookie_daemon/__main__.py | mcgreevy/chromium-infra | 09064105713603f7bf75c772e8354800a1bfa256 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | infra/services/git_cookie_daemon/__main__.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs a daemon to update git credentials from the GCE metadata server.
Only works inside a GCE with proper service accounts tagged.
Example invocation:
./... | 27.918919 | 82 | 0.782188 | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs a daemon to update git credentials from the GCE metadata server.
Only works inside a GCE with proper service accounts tagged.
Example invocation:
./... | 129 | 154 | 23 |
9bf8bc76fcfa8ccfcebcf14cb09f38b86defe4b7 | 6,819 | py | Python | tests/lib/policy_simple_test.py | qwe19272375/capirca | fb46152060928e58393b81f8742b2606d0f42fd9 | [
"Apache-2.0"
] | null | null | null | tests/lib/policy_simple_test.py | qwe19272375/capirca | fb46152060928e58393b81f8742b2606d0f42fd9 | [
"Apache-2.0"
] | null | null | null | tests/lib/policy_simple_test.py | qwe19272375/capirca | fb46152060928e58393b81f8742b2606d0f42fd9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# unless required by applicable law or a... | 29.519481 | 74 | 0.660507 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# unless required by applicable law or a... | 5,110 | 64 | 767 |
56eba6ef628cdbeb533634951e90ea0ae25ae02b | 1,414 | py | Python | rules/streckerDegradationDicarbonyl.py | Reaction-Space-Explorer/reac-space-exp | 02c91247d9ee5107cbf9fa113e87edaf4bd392b0 | [
"BSD-3-Clause"
] | 4 | 2020-06-27T23:08:41.000Z | 2022-01-09T16:20:48.000Z | rules/streckerDegradationDicarbonyl.py | sahilrajiv/reac-space-exp | 52f4b4eab755bd4a6830d838828c958149567396 | [
"BSD-3-Clause"
] | 15 | 2020-07-27T23:14:32.000Z | 2022-03-12T00:59:20.000Z | rules/streckerDegradationDicarbonyl.py | sahilrajiv/reac-space-exp | 52f4b4eab755bd4a6830d838828c958149567396 | [
"BSD-3-Clause"
] | 3 | 2020-06-27T23:08:46.000Z | 2021-04-20T09:29:33.000Z | include("common.py")
streckerDegradationDicarbonyl = [a for a in streckerDegradationDicarbonylGen()] | 32.883721 | 79 | 0.57355 | include("common.py")
def streckerDegradationDicarbonylGen():
r = RuleGen("Strecker Degradation Dicarbonyl")
r.left.extend([
'edge [ source 1 target 2 label "-" ]',
'edge [ source 2 target 3 label "-" ]',
'edge [ source 3 target 5 label "-" ]',
'edge [ source 5 target 8 label "-" ]',
'edge [ source 14 targe... | 1,291 | 0 | 23 |
a08d8280d6a9398a46eb19ed3e49e861227ba24d | 6,457 | py | Python | saio.py | coroa/saio | 8ac8a501a6fde4d9eb1ffdf57b6084d555b205cb | [
"MIT"
] | 2 | 2019-03-06T21:38:56.000Z | 2020-04-22T12:23:54.000Z | saio.py | coroa/saio | 8ac8a501a6fde4d9eb1ffdf57b6084d555b205cb | [
"MIT"
] | 6 | 2019-03-06T21:41:09.000Z | 2022-03-26T08:00:07.000Z | saio.py | coroa/saio | 8ac8a501a6fde4d9eb1ffdf57b6084d555b205cb | [
"MIT"
] | null | null | null | """
SQLAlchemyIO (saio): Module hack for autoloading table definitions
## Usage
After
```python
import saio
saio.register_schema("model_draft", engine)
````
one can import table declarations easily using
```python
from saio.model_draft import lis_charging_poi as LisChargingPoi
```
Note that `ipython... | 30.894737 | 129 | 0.675081 | """
SQLAlchemyIO (saio): Module hack for autoloading table definitions
## Usage
After
```python
import saio
saio.register_schema("model_draft", engine)
````
one can import table declarations easily using
```python
from saio.model_draft import lis_charging_poi as LisChargingPoi
```
Note that `ipython... | 1,752 | 237 | 69 |
e81fae726a1ad4d4a8d28c4d33b258d269c98b99 | 2,828 | py | Python | apps/crm/views/stage.py | picsldev/pyerp | e998e3e99a4e45033d54a6b1df50697f7288f67f | [
"MIT"
] | null | null | null | apps/crm/views/stage.py | picsldev/pyerp | e998e3e99a4e45033d54a6b1df50697f7288f67f | [
"MIT"
] | null | null | null | apps/crm/views/stage.py | picsldev/pyerp | e998e3e99a4e45033d54a6b1df50697f7288f67f | [
"MIT"
] | null | null | null | # Librerias Django
from django.contrib.auth import authenticate
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.shortcuts import redirect, render
from django.urls import reverse, reverse_lazy
from... | 34.487805 | 95 | 0.679632 | # Librerias Django
from django.contrib.auth import authenticate
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.shortcuts import redirect, render
from django.urls import reverse, reverse_lazy
from... | 1,386 | 626 | 114 |
60924a7cbecc66b7fbce0b414d032fd205a423ac | 12,586 | py | Python | spykes/plot/popvis.py | jess-breda/spykes | 465c1adac1d780ce2e5f1f40b351bcb44560130f | [
"MIT"
] | 90 | 2016-06-26T21:39:34.000Z | 2022-01-27T21:53:34.000Z | spykes/plot/popvis.py | jess-breda/spykes | 465c1adac1d780ce2e5f1f40b351bcb44560130f | [
"MIT"
] | 74 | 2016-06-25T22:41:11.000Z | 2021-05-15T00:14:23.000Z | spykes/plot/popvis.py | jess-breda/spykes | 465c1adac1d780ce2e5f1f40b351bcb44560130f | [
"MIT"
] | 45 | 2016-06-27T19:54:18.000Z | 2021-02-12T22:30:15.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import copy
from collections import defaultdict
from fractions import gcd
from .neurovis import NeuroVis
from .. import utils
from ..config import DEFAULT_PO... | 39.208723 | 79 | 0.559113 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import copy
from collections import defaultdict
from fractions import gcd
from .neurovis import NeuroVis
from .. import utils
from ..config import DEFAULT_PO... | 147 | 0 | 79 |
f88b293ab03588e75c2f461e53d2b07865593e23 | 3,370 | py | Python | Jati/Base/Session.py | ghuvrons/Jati | b4d056cf38d4770f3bef0f3db93c4b982f4e3da0 | [
"MIT"
] | null | null | null | Jati/Base/Session.py | ghuvrons/Jati | b4d056cf38d4770f3bef0f3db93c4b982f4e3da0 | [
"MIT"
] | null | null | null | Jati/Base/Session.py | ghuvrons/Jati | b4d056cf38d4770f3bef0f3db93c4b982f4e3da0 | [
"MIT"
] | null | null | null | import threading
import random
import time
import datetime
import pickle, os
| 37.444444 | 110 | 0.57003 | import threading
import random
import time
import datetime
import pickle, os
class session:
def __init__(self, sesid, timeout = 259200):
self.id = sesid
self.timeout = timeout
self.idle = datetime.datetime.now()
self.data = {}
def setData(self, param, value):
self.data[pa... | 2,926 | 11 | 356 |
3bc5b198c69993a00df6165e67936f446170c0a9 | 8,234 | py | Python | fuzzy_search/fuzzy_string.py | marijnkoolen/fuzzy-search | c2dddcb76b18d122acbec8140470f8e72264472b | [
"MIT"
] | 12 | 2019-11-03T17:18:21.000Z | 2022-03-31T16:37:28.000Z | fuzzy_search/fuzzy_string.py | marijnkoolen/fuzzy-search | c2dddcb76b18d122acbec8140470f8e72264472b | [
"MIT"
] | null | null | null | fuzzy_search/fuzzy_string.py | marijnkoolen/fuzzy-search | c2dddcb76b18d122acbec8140470f8e72264472b | [
"MIT"
] | 1 | 2021-02-25T12:43:03.000Z | 2021-02-25T12:43:03.000Z | from typing import List, Generator
from itertools import combinations
#################################
# String manipulation functions #
#################################
def make_ngrams(text: str, n: int) -> List[str]:
"""Turn a term string into a list of ngrams of size n
:param text: a text string
:t... | 30.272059 | 111 | 0.618533 | from typing import List, Generator
from itertools import combinations
#################################
# String manipulation functions #
#################################
def make_ngrams(text: str, n: int) -> List[str]:
"""Turn a term string into a list of ngrams of size n
:param text: a text string
:t... | 160 | -6 | 50 |
abf2113a7b3c8829158e47ea2e997067c04fc1ab | 1,872 | py | Python | application/kilpailut/models.py | tikibeni/windsurf-ranking | a20ccc6b9bf924032c94fff8a1bba65ecfc1f1d4 | [
"MIT"
] | null | null | null | application/kilpailut/models.py | tikibeni/windsurf-ranking | a20ccc6b9bf924032c94fff8a1bba65ecfc1f1d4 | [
"MIT"
] | 2 | 2019-11-26T15:27:28.000Z | 2020-10-19T15:15:40.000Z | application/kilpailut/models.py | tikibeni/windsurf-ranking | a20ccc6b9bf924032c94fff8a1bba65ecfc1f1d4 | [
"MIT"
] | null | null | null | from application import db
from datetime import datetime
from sqlalchemy import text
# Kilpailu-taulun luominen | 37.44 | 176 | 0.744124 | from application import db
from datetime import datetime
from sqlalchemy import text
# Kilpailu-taulun luominen
class Kilpailu(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), nullable=False)
venue = db.Column(db.String(30), nullable=False)
startdate = db.Column(db.Date, null... | 1,085 | 654 | 22 |
357b300c36b285fa6d012815d9109b394657909d | 477 | py | Python | painter/Libraries/paint/blender.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | 2 | 2019-03-20T13:10:46.000Z | 2019-05-15T20:00:31.000Z | painter/Libraries/paint/blender.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | null | null | null | painter/Libraries/paint/blender.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | null | null | null | import bpy
import arm.material.mat_utils
import arm.write_data
import arm.assets
import arm.make_renderpath
import arm.make_state
import arm.utils
| 28.058824 | 76 | 0.777778 | import bpy
import arm.material.mat_utils
import arm.write_data
import arm.assets
import arm.make_renderpath
import arm.make_state
import arm.utils
def on_make_renderpath():
arm.assets.add_shader_pass('copy_mrt3_pass')
arm.assets.add(arm.utils.get_sdk_path() + '/armory/Assets/noise256.png')
arm.assets.add_e... | 284 | 0 | 46 |
831173f80245a78a4acf6b965b2ed6098c1e583b | 9,497 | py | Python | im.py | regismeyssonnier/NeuralNetwork | c998b9523ed02287e1c811d73b0757270dee773c | [
"MIT"
] | null | null | null | im.py | regismeyssonnier/NeuralNetwork | c998b9523ed02287e1c811d73b0757270dee773c | [
"MIT"
] | null | null | null | im.py | regismeyssonnier/NeuralNetwork | c998b9523ed02287e1c811d73b0757270dee773c | [
"MIT"
] | null | null | null | import cv2
import sys
from filter import *
from mix import *
TEST = []
TEST_out = []
SIZE_I = 16
TEST, TEST_out, PATH = create_test_tab_one_filter_rand_train()
# TEST, TEST_out = create_test_tab_filter()
TESTV, TESTV_out, PATHV = create_test_tab_one_filter_rand_valid()
#TESTV, TESTV_out = create_valid_tab_filter... | 18.1587 | 89 | 0.629778 | import cv2
import sys
from filter import *
from mix import *
TEST = []
TEST_out = []
SIZE_I = 16
def load_image(name):
img = cv2.imread(name)
print(name)
if img is None:
print('Failed to load image file:', name)
sys.exit(1)
imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
#ret,mask = cv2.threshold(imgGray... | 8,621 | 0 | 395 |
523d4250abca117543d17b39a595b9579b5e623f | 684 | py | Python | p40.py | sadimanna/project_euler | fe7907917bb59d186f84f0942629d108fa2a13da | [
"MIT"
] | 1 | 2020-08-17T08:48:28.000Z | 2020-08-17T08:48:28.000Z | p40.py | sadimanna/project_euler | fe7907917bb59d186f84f0942629d108fa2a13da | [
"MIT"
] | null | null | null | p40.py | sadimanna/project_euler | fe7907917bb59d186f84f0942629d108fa2a13da | [
"MIT"
] | 1 | 2020-08-16T07:37:07.000Z | 2020-08-16T07:37:07.000Z | import time
st = time.time()
fraction = "0."
places_of_digits = [1,10,100,1000,10000,100000,1000000]
pod = 0
d_index = places_of_digits[pod]
result = 1
present_num = 0
lenfp = 0
done = 0
while(lenfp <= places_of_digits[-1]):
present_num = present_num + 1
fraction = fraction + str(present_num)
lenpn = len(str(prese... | 24.428571 | 55 | 0.663743 | import time
st = time.time()
fraction = "0."
places_of_digits = [1,10,100,1000,10000,100000,1000000]
pod = 0
d_index = places_of_digits[pod]
result = 1
present_num = 0
lenfp = 0
done = 0
while(lenfp <= places_of_digits[-1]):
present_num = present_num + 1
fraction = fraction + str(present_num)
lenpn = len(str(prese... | 0 | 0 | 0 |
f0712d4b7001575a10a7b2d1052e11c34861cbd6 | 981 | py | Python | setup.py | microsoft/torchy | 2c36cc50246dfeb22b9d65a402050398b78c14e5 | [
"MIT"
] | 4 | 2021-12-30T19:54:57.000Z | 2022-03-15T23:59:55.000Z | setup.py | microsoft/torchy | 2c36cc50246dfeb22b9d65a402050398b78c14e5 | [
"MIT"
] | null | null | null | setup.py | microsoft/torchy | 2c36cc50246dfeb22b9d65a402050398b78c14e5 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CppExtension
from glob import glob
import os
sanitizers = [
#'-fsanitize=undefined', '-fsanitize-undefined-trap-on-error'
#'-fsanitize=address,undefined'
]
extra_compile_args = [
'-I' + os.path.realpath('.'),
'-m... | 22.813953 | 66 | 0.686035 | from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CppExtension
from glob import glob
import os
sanitizers = [
#'-fsanitize=undefined', '-fsanitize-undefined-trap-on-error'
#'-fsanitize=address,undefined'
]
extra_compile_args = [
'-I' + os.path.realpath('.'),
'-m... | 0 | 0 | 0 |
8ccd67cc8a84b31f2f4f8658a019f77ab2362f1f | 4,287 | py | Python | tests/decorator_test.py | f-dangel/hbp | 3ed208ce16fae1c2697e1d5220de91205e1d13c3 | [
"MIT"
] | 13 | 2020-02-27T00:24:27.000Z | 2022-01-09T05:35:46.000Z | tests/decorator_test.py | f-dangel/hbp | 3ed208ce16fae1c2697e1d5220de91205e1d13c3 | [
"MIT"
] | 5 | 2021-06-08T21:00:04.000Z | 2022-03-12T00:17:39.000Z | tests/decorator_test.py | f-dangel/hbp | 3ed208ce16fae1c2697e1d5220de91205e1d13c3 | [
"MIT"
] | 2 | 2020-09-10T03:34:07.000Z | 2022-01-09T05:35:50.000Z | """Test decorator of torch.nn.Module subclasses."""
from torch import Tensor
from torch.nn import Linear
from bpexts.decorator import decorate
# decorated linear layer
DecoratedAffine = decorate(Linear)
def test_decorated_linear_properties():
"""Test name and docstring of decorated torch.nn.Linear."""
asse... | 32.233083 | 78 | 0.70119 | """Test decorator of torch.nn.Module subclasses."""
from torch import Tensor
from torch.nn import Linear
from bpexts.decorator import decorate
# decorated linear layer
DecoratedAffine = decorate(Linear)
def test_decorated_linear_properties():
"""Test name and docstring of decorated torch.nn.Linear."""
asse... | 0 | 0 | 0 |
b6cc423283d0e2350a2773a3434525e1632aee6d | 5,973 | py | Python | tests/kwargs/test_validations.py | t1waz/starlite | f25a21c3785dce406b42d15859f445c919ec1875 | [
"MIT"
] | 334 | 2022-01-07T12:14:54.000Z | 2022-03-30T23:28:03.000Z | tests/kwargs/test_validations.py | t1waz/starlite | f25a21c3785dce406b42d15859f445c919ec1875 | [
"MIT"
] | 70 | 2022-01-06T18:41:33.000Z | 2022-03-23T20:21:33.000Z | tests/kwargs/test_validations.py | t1waz/starlite | f25a21c3785dce406b42d15859f445c919ec1875 | [
"MIT"
] | 24 | 2022-01-06T22:02:01.000Z | 2022-03-20T01:43:39.000Z | from typing import Any, Callable, Dict
import pytest
from pydantic.fields import FieldInfo
from starlite import (
Body,
HTTPRouteHandler,
ImproperlyConfiguredException,
Parameter,
Provide,
RequestEncodingType,
Starlite,
get,
post,
websocket,
)
from starlite.constants import RES... | 36.644172 | 141 | 0.742843 | from typing import Any, Callable, Dict
import pytest
from pydantic.fields import FieldInfo
from starlite import (
Body,
HTTPRouteHandler,
ImproperlyConfiguredException,
Parameter,
Provide,
RequestEncodingType,
Starlite,
get,
post,
websocket,
)
from starlite.constants import RES... | 3,353 | 0 | 400 |
553a88e56e6ab589bf2569d3f825f84258c23158 | 4,856 | py | Python | seven23/api/categories/tests_categories.py | sebastienbarbier/723e_server | 3501d143d371355a88bf3129828a9d5fd61d6be4 | [
"MIT"
] | 27 | 2019-03-07T17:23:59.000Z | 2022-01-29T16:08:09.000Z | seven23/api/categories/tests_categories.py | sebastienbarbier/723e_server | 3501d143d371355a88bf3129828a9d5fd61d6be4 | [
"MIT"
] | 31 | 2017-06-14T08:19:48.000Z | 2022-01-26T14:55:39.000Z | seven23/api/categories/tests_categories.py | sebastienbarbier/723e_server | 3501d143d371355a88bf3129828a9d5fd61d6be4 | [
"MIT"
] | 14 | 2019-07-22T09:49:13.000Z | 2021-12-21T08:52:02.000Z | """
Tests Account API
"""
import json
import datetime
from django.test import TransactionTestCase
# Default user model may get swapped out of the system and hence.
from django.contrib.auth.models import User
from rest_framework.test import APIClient
from rest_framework import status
from seven23.models.accounts.... | 39.16129 | 102 | 0.573929 | """
Tests Account API
"""
import json
import datetime
from django.test import TransactionTestCase
# Default user model may get swapped out of the system and hence.
from django.contrib.auth.models import User
from rest_framework.test import APIClient
from rest_framework import status
from seven23.models.accounts.... | 1,264 | 0 | 27 |
8fb0d47ccc65158a01814e6fcc4dc579c5843973 | 3,758 | py | Python | persons.py | tobbee/skojjt | 4d209291be1741cb9a0a35890fb9a6c2e72e0eec | [
"Apache-2.0"
] | null | null | null | persons.py | tobbee/skojjt | 4d209291be1741cb9a0a35890fb9a6c2e72e0eec | [
"Apache-2.0"
] | null | null | null | persons.py | tobbee/skojjt | 4d209291be1741cb9a0a35890fb9a6c2e72e0eec | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import scoutnet
from dataimport import UserPrefs, ndb, Person, logging, TroopPerson, ScoutGroup
from flask import Blueprint, render_template, abort, redirect, request
persons = Blueprint('persons_page', __name__, template_folder='templates')
@persons.route('/')
@persons.route('/<sgroup_url>')... | 30.552846 | 123 | 0.673497 | # -*- coding: utf-8 -*-
import scoutnet
from dataimport import UserPrefs, ndb, Person, logging, TroopPerson, ScoutGroup
from flask import Blueprint, render_template, abort, redirect, request
persons = Blueprint('persons_page', __name__, template_folder='templates')
@persons.route('/')
@persons.route('/<sgroup_url>')... | 3,237 | 0 | 22 |
658ea14b40e7127225e01a7db2ae1d53c9e9f900 | 273 | py | Python | bot.py | Wirexia-git/instagram-bot | 6b718b195c53bf4d0ee19cc55bd87f680bce8cd6 | [
"MIT"
] | null | null | null | bot.py | Wirexia-git/instagram-bot | 6b718b195c53bf4d0ee19cc55bd87f680bce8cd6 | [
"MIT"
] | null | null | null | bot.py | Wirexia-git/instagram-bot | 6b718b195c53bf4d0ee19cc55bd87f680bce8cd6 | [
"MIT"
] | null | null | null | from instabot import Bot
COOKIE_FNAME = 'cookie.txt'
bot = Bot()
bot.login(username="wirexia66@gmail.com", password="reNcDjEgWp4X7Gt", use_cookie = False)
user_id = bot.get_user_id_from_username("lego")
user_info = bot.get_user_info(user_id)
print(user_info['biography']) | 30.333333 | 89 | 0.78022 | from instabot import Bot
COOKIE_FNAME = 'cookie.txt'
bot = Bot()
bot.login(username="wirexia66@gmail.com", password="reNcDjEgWp4X7Gt", use_cookie = False)
user_id = bot.get_user_id_from_username("lego")
user_info = bot.get_user_info(user_id)
print(user_info['biography']) | 0 | 0 | 0 |
319e885c2f738b63e78b34eb95735a54901bce46 | 59 | py | Python | mesoor_recommendation_sdk/__init__.py | nadileaf/mesoor-recommendation-python-sdk | 61d132ab42601f2b6423544f47c9438fad2da3f4 | [
"MIT"
] | null | null | null | mesoor_recommendation_sdk/__init__.py | nadileaf/mesoor-recommendation-python-sdk | 61d132ab42601f2b6423544f47c9438fad2da3f4 | [
"MIT"
] | null | null | null | mesoor_recommendation_sdk/__init__.py | nadileaf/mesoor-recommendation-python-sdk | 61d132ab42601f2b6423544f47c9438fad2da3f4 | [
"MIT"
] | null | null | null | from .sdk import MesoorRecommendation
from . import models
| 19.666667 | 37 | 0.830508 | from .sdk import MesoorRecommendation
from . import models
| 0 | 0 | 0 |
885b02125c4fe252d3c4f00e075279fbcec6d28a | 3,810 | py | Python | app/src/main/python/main.py | arlessweschler/YTDLAndroidDownloader | 9e6bfc87b2455cd2bd96db61e0a30db6e7bf6b4f | [
"MIT"
] | 1 | 2020-08-20T00:22:37.000Z | 2020-08-20T00:22:37.000Z | app/src/main/python/main.py | arlessweschler/YTDLAndroidDownloader | 9e6bfc87b2455cd2bd96db61e0a30db6e7bf6b4f | [
"MIT"
] | 18 | 2020-08-18T19:46:07.000Z | 2021-07-29T06:19:20.000Z | app/src/main/python/main.py | arlessweschler/YTDLAndroidDownloader | 9e6bfc87b2455cd2bd96db61e0a30db6e7bf6b4f | [
"MIT"
] | 1 | 2020-08-23T17:26:38.000Z | 2020-08-23T17:26:38.000Z | from java import dynamic_proxy
from java.lang import Runnable
import os
import youtube_dl as yt
from com.arthenica.mobileffmpeg import FFmpeg | 36.990291 | 150 | 0.473491 | from java import dynamic_proxy
from java.lang import Runnable
import os
import youtube_dl as yt
from com.arthenica.mobileffmpeg import FFmpeg
def run(activity, url, audioOnly, progressW, percentageW, velocityW, quality, path):
class R(dynamic_proxy(Runnable)):
def __init__(self):
super(R, self)... | 3,646 | 0 | 23 |
c23b4b0f516f5280a8a5a034bd3f45d99ce68a61 | 88 | py | Python | vgraph/graph/__init__.py | sharath/vgraph | dd636600a0fa6a5cb3314b15347655613d0e9a75 | [
"MIT"
] | null | null | null | vgraph/graph/__init__.py | sharath/vgraph | dd636600a0fa6a5cb3314b15347655613d0e9a75 | [
"MIT"
] | null | null | null | vgraph/graph/__init__.py | sharath/vgraph | dd636600a0fa6a5cb3314b15347655613d0e9a75 | [
"MIT"
] | null | null | null | from .edge import *
from .vertex import *
from .graph import *
from .generators import * | 22 | 25 | 0.738636 | from .edge import *
from .vertex import *
from .graph import *
from .generators import * | 0 | 0 | 0 |
571e81ce91c98448a81aa3e2d3a71f7dd6c4b68d | 195 | py | Python | Mundo 1/ArquivosComCores/File 005.py | PedroHenriqueSimoes/Exercicios-Python | 702a819d508dd7878b88fb676559d899237ac761 | [
"MIT"
] | 1 | 2020-04-30T21:32:01.000Z | 2020-04-30T21:32:01.000Z | Mundo 1/ArquivosComCores/File 005.py | PedroHenriqueSimoes/Exercicios-Python | 702a819d508dd7878b88fb676559d899237ac761 | [
"MIT"
] | 1 | 2021-10-05T02:00:04.000Z | 2021-10-05T02:00:04.000Z | Mundo 1/ArquivosComCores/File 005.py | PedroHenriqueSimoes/Exercicios-Python | 702a819d508dd7878b88fb676559d899237ac761 | [
"MIT"
] | null | null | null | num = (int(input('\033[0;34mDigite um numero: \033[m')))
print('\033[0;32mO numero digitado foi {},'.format(num))
print('seu sucessor é {}, e seu antecessor é {}.\033[m'.format(num + 1, num- 1))
| 48.75 | 80 | 0.641026 | num = (int(input('\033[0;34mDigite um numero: \033[m')))
print('\033[0;32mO numero digitado foi {},'.format(num))
print('seu sucessor é {}, e seu antecessor é {}.\033[m'.format(num + 1, num- 1))
| 0 | 0 | 0 |
a0acd7b6e03ad3fa52cd120275cac0b109748e2f | 386 | py | Python | lib/elevator/predicate.py | vt77/elevator | 3f692c50b0ee45c28dbd9045f6f1892aca06fd23 | [
"MIT"
] | null | null | null | lib/elevator/predicate.py | vt77/elevator | 3f692c50b0ee45c28dbd9045f6f1892aca06fd23 | [
"MIT"
] | null | null | null | lib/elevator/predicate.py | vt77/elevator | 3f692c50b0ee45c28dbd9045f6f1892aca06fd23 | [
"MIT"
] | null | null | null |
class Predicate():
"""
This class should predicate most usefull floor to send elevator in idle state
The purpose to minimize wait time om next call. And just for fun
Predication may be performed by external tools, based on statistics table
For now it do nothing.
"""
predict = Predicate(... | 21.444444 | 81 | 0.694301 |
class Predicate():
"""
This class should predicate most usefull floor to send elevator in idle state
The purpose to minimize wait time om next call. And just for fun
Predication may be performed by external tools, based on statistics table
For now it do nothing.
"""
def get_floor(self,... | 38 | 0 | 27 |
10c9949bb88fa27e603128f2b66c3122bad49f07 | 8,977 | py | Python | SampleScripts/Static_Only/nsgaii.py | kyspencer/GAMMA-PC-A-Greedy-Memetic-Algorithm-for-Storing-Cooling-Objects | 3462ff8cc555ad646b59909c661ca58b21294a7b | [
"MIT"
] | null | null | null | SampleScripts/Static_Only/nsgaii.py | kyspencer/GAMMA-PC-A-Greedy-Memetic-Algorithm-for-Storing-Cooling-Objects | 3462ff8cc555ad646b59909c661ca58b21294a7b | [
"MIT"
] | null | null | null | SampleScripts/Static_Only/nsgaii.py | kyspencer/GAMMA-PC-A-Greedy-Memetic-Algorithm-for-Storing-Cooling-Objects | 3462ff8cc555ad646b59909c661ca58b21294a7b | [
"MIT"
] | 1 | 2019-11-11T21:43:34.000Z | 2019-11-11T21:43:34.000Z | # nsgaii.py
# Program to run NSGA-II on benchmark problems
# Author: Kristina Spencer
# Date: March 10, 2016
# i - bin index
# j - item index
# k - algorithm index
# m - solution index
# t - generation ind#x
from __future__ import print_function
import binpacking as bp
import datetime
import ga... | 29.241042 | 97 | 0.530467 | # nsgaii.py
# Program to run NSGA-II on benchmark problems
# Author: Kristina Spencer
# Date: March 10, 2016
# i - bin index
# j - item index
# k - algorithm index
# m - solution index
# t - generation ind#x
from __future__ import print_function
import binpacking as bp
import datetime
import ga... | 7,896 | -4 | 580 |
ed7298541ecee5fc8f87eb98331e8a9df2abdc20 | 559 | py | Python | source/actors/simulated_human.py | yuhangc/hri_planner_sim | fe4ff1bd5c522ed015798461b53a697095471849 | [
"Apache-2.0"
] | null | null | null | source/actors/simulated_human.py | yuhangc/hri_planner_sim | fe4ff1bd5c522ed015798461b53a697095471849 | [
"Apache-2.0"
] | null | null | null | source/actors/simulated_human.py | yuhangc/hri_planner_sim | fe4ff1bd5c522ed015798461b53a697095471849 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from actor_base import Actor
class SimulatedPathFollowingHuman(Actor):
"""
A simulated human object that only follows a given path
"""
class SimulatedReactiveHuman(Actor):
"""
A reactive human object that follows a path but reacts
to robot's movement
"""
| 21.5 | 59 | 0.660107 | import numpy as np
from actor_base import Actor
class SimulatedPathFollowingHuman(Actor):
"""
A simulated human object that only follows a given path
"""
def __init__(self, fp_radius=0.3):
Actor.__init__(self, fp_radius)
class SimulatedReactiveHuman(Actor):
"""
A reactive human obje... | 173 | 0 | 79 |
39de78534e66946caec5bd4b6fc32929f90a31fc | 2,626 | py | Python | mypythontools_cicd/deploy/deploy_internal.py | Malachov/mypythontools_cicd | 43bcd24f068c4823ecfaf97b2eedf1bf06d58cfc | [
"MIT"
] | null | null | null | mypythontools_cicd/deploy/deploy_internal.py | Malachov/mypythontools_cicd | 43bcd24f068c4823ecfaf97b2eedf1bf06d58cfc | [
"MIT"
] | null | null | null | mypythontools_cicd/deploy/deploy_internal.py | Malachov/mypythontools_cicd | 43bcd24f068c4823ecfaf97b2eedf1bf06d58cfc | [
"MIT"
] | null | null | null | """Module with functions for 'deploy' subpackage."""
from __future__ import annotations
import os
import shutil
import mylogging
from mypythontools.paths import validate_path, PathLike
from mypythontools.misc import delete_files
from mypythontools.system import check_script_is_available, terminal_do_command, PYTHON
... | 33.240506 | 108 | 0.702209 | """Module with functions for 'deploy' subpackage."""
from __future__ import annotations
import os
import shutil
import mylogging
from mypythontools.paths import validate_path, PathLike
from mypythontools.misc import delete_files
from mypythontools.system import check_script_is_available, terminal_do_command, PYTHON
... | 0 | 0 | 0 |
cdd16696fabec06ff6d966a7f39e4e7d925c47db | 708 | py | Python | setup.py | BureauxLocaux/dj-sellsy | e0a2c52bcf17850442b1ba266b8dfa4efa383b57 | [
"MIT"
] | null | null | null | setup.py | BureauxLocaux/dj-sellsy | e0a2c52bcf17850442b1ba266b8dfa4efa383b57 | [
"MIT"
] | null | null | null | setup.py | BureauxLocaux/dj-sellsy | e0a2c52bcf17850442b1ba266b8dfa4efa383b57 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="dj-sellsy",
version="0.1",
author="Mathieu Richardoz",
author_email="mathieu.richardoz@bureauxlocaux.com",
description="A package to facilitate Django-Sellsy integration",
long_descrip... | 26.222222 | 68 | 0.661017 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="dj-sellsy",
version="0.1",
author="Mathieu Richardoz",
author_email="mathieu.richardoz@bureauxlocaux.com",
description="A package to facilitate Django-Sellsy integration",
long_descrip... | 0 | 0 | 0 |
1d09cf7c756f07e34961655b6fe22ab559a6177d | 161 | py | Python | pacote-download/pythonProject/exercicios_python_guanabara/ex047.py | oliveirajonathas/python_estudos | 28921672d7e5d0866030c45b077a28998905f752 | [
"MIT"
] | null | null | null | pacote-download/pythonProject/exercicios_python_guanabara/ex047.py | oliveirajonathas/python_estudos | 28921672d7e5d0866030c45b077a28998905f752 | [
"MIT"
] | null | null | null | pacote-download/pythonProject/exercicios_python_guanabara/ex047.py | oliveirajonathas/python_estudos | 28921672d7e5d0866030c45b077a28998905f752 | [
"MIT"
] | null | null | null | """
Faça um programa que mostre na tela todos os números pares entre 1 e 50
"""
for i in range(1, 51):
if i % 2 == 0:
print(i, end=' ')
print('FIM')
| 20.125 | 71 | 0.57764 | """
Faça um programa que mostre na tela todos os números pares entre 1 e 50
"""
for i in range(1, 51):
if i % 2 == 0:
print(i, end=' ')
print('FIM')
| 0 | 0 | 0 |
54e4ff9e5af126866ca07a5701042a56bb2cc7ff | 1,921 | py | Python | datasets/transform.py | LiheYoung/SenseEarth2020-ChangeDetection | ec7c906fbc06c8b2a58009bfe63d437d726303e2 | [
"MIT"
] | 146 | 2020-11-05T12:52:15.000Z | 2022-03-30T03:09:35.000Z | datasets/transform.py | LiheYoung/SenseEarth2020-ChangeDetection | ec7c906fbc06c8b2a58009bfe63d437d726303e2 | [
"MIT"
] | 15 | 2021-01-18T06:04:44.000Z | 2022-03-10T03:46:10.000Z | datasets/transform.py | LiheYoung/SenseEarth2020-ChangeDetection | ec7c906fbc06c8b2a58009bfe63d437d726303e2 | [
"MIT"
] | 33 | 2020-12-21T08:13:40.000Z | 2022-03-20T04:13:15.000Z | from PIL import Image
import random
| 40.87234 | 97 | 0.618948 | from PIL import Image
import random
class RandomFlipOrRotate(object):
def __call__(self, sample):
img1, img2, mask1, mask2, mask_bin = \
sample['img1'], sample['img2'], sample['mask1'], sample['mask2'], sample['mask_bin']
rand = random.random()
if rand < 1 / 6:
img... | 1,823 | 12 | 49 |
71aba05c18e45da760ce5621c3e6e06ebcfc3380 | 9,810 | py | Python | tools/texexport.py | infancy/oryol | 06b580116cc2e929b9e1a85920a74fb32d76493c | [
"MIT"
] | 1,707 | 2015-01-01T14:56:08.000Z | 2022-03-28T06:44:09.000Z | tools/texexport.py | infancy/oryol | 06b580116cc2e929b9e1a85920a74fb32d76493c | [
"MIT"
] | 256 | 2015-01-03T14:55:53.000Z | 2020-09-09T10:43:46.000Z | tools/texexport.py | infancy/oryol | 06b580116cc2e929b9e1a85920a74fb32d76493c | [
"MIT"
] | 222 | 2015-01-05T00:20:54.000Z | 2022-02-06T01:41:37.000Z | #!/usr/bin/env python
'''
Oryol texture export functions
'''
import sys
import os
import platform
import subprocess
import tempfile
ProjectDirectory = os.path.dirname(os.path.abspath(__file__)) + '/..'
TexSrcDirectory = ProjectDirectory + '/data'
TexDstDirectory = ProjectDirectory + '/build/webpage'
# NOTE: PVRTexToo... | 37.876448 | 124 | 0.559021 | #!/usr/bin/env python
'''
Oryol texture export functions
'''
import sys
import os
import platform
import subprocess
import tempfile
ProjectDirectory = os.path.dirname(os.path.abspath(__file__)) + '/..'
TexSrcDirectory = ProjectDirectory + '/data'
TexDstDirectory = ProjectDirectory + '/build/webpage'
# NOTE: PVRTexToo... | 3,105 | 0 | 110 |
15d463f854b68ea288949bab40e2007599c90afa | 2,037 | py | Python | backstack/controllers.py | pixlie/platform | 10782e9ddfb1dc2311e22987a16e9e77f3d71d34 | [
"MIT"
] | 2 | 2019-06-06T11:21:35.000Z | 2021-12-19T12:17:02.000Z | backstack/controllers.py | pixlie/backstack | 10782e9ddfb1dc2311e22987a16e9e77f3d71d34 | [
"MIT"
] | null | null | null | backstack/controllers.py | pixlie/backstack | 10782e9ddfb1dc2311e22987a16e9e77f3d71d34 | [
"MIT"
] | null | null | null | from sanic.views import HTTPMethodView
from .errors import NotFound
| 29.521739 | 55 | 0.594502 | from sanic.views import HTTPMethodView
from .errors import NotFound
class BaseController(HTTPMethodView):
request = None
kwargs = None
__request_initiated = False
def init_request(self, request, *args, **kwargs):
self.request = request
self.kwargs = kwargs
self.__request_init... | 1,670 | 274 | 23 |
71c1dfa9068d28774bc922fc0a1c22c7b6df071e | 30,376 | py | Python | katie/SVD_Code_NEW/Watermarking_New/watermark_experiments.py | S-I-SVD/Randomized-SVD | 82108238a53c70938af87417f98aadc7f74b2a87 | [
"MIT"
] | 1 | 2021-12-09T13:34:44.000Z | 2021-12-09T13:34:44.000Z | katie/SVD_Code_NEW/Watermarking_New/watermark_experiments.py | S-I-SVD/Randomized-SVD | 82108238a53c70938af87417f98aadc7f74b2a87 | [
"MIT"
] | null | null | null | katie/SVD_Code_NEW/Watermarking_New/watermark_experiments.py | S-I-SVD/Randomized-SVD | 82108238a53c70938af87417f98aadc7f74b2a87 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import os
import imageio
from timeit import timeit
from mpl_toolkits import mplot3d
from PIL import Image
#import png
import svd_tools_copy as svdt
import image_tools_copy as it
#import ../../../david/watermark as watermarktools
#sunset = it.load_im... | 47.536776 | 174 | 0.739992 | import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import os
import imageio
from timeit import timeit
from mpl_toolkits import mplot3d
from PIL import Image
#import png
import svd_tools_copy as svdt
import image_tools_copy as it
#import ../../../david/watermark as watermarktools
#sunset = it.load_im... | 28,563 | 0 | 899 |
fc28bc2e5440c5b72ac6325f6417e99d5f90253a | 45,769 | py | Python | build/releases/release-0.527/src/lisp-ms.py | farinacci/lispers.net | e1ed6e0f0a242b13ad629afb0fc1c7072b19b30c | [
"Apache-2.0"
] | 26 | 2019-02-01T19:12:21.000Z | 2022-03-25T04:40:38.000Z | build/releases/release-0.527/src/lisp-ms.py | farinacci/lispers.net | e1ed6e0f0a242b13ad629afb0fc1c7072b19b30c | [
"Apache-2.0"
] | 3 | 2019-10-29T17:49:19.000Z | 2022-03-20T21:21:31.000Z | build/releases/release-0.528/src/lisp-ms.py | farinacci/lispers.net | e1ed6e0f0a242b13ad629afb0fc1c7072b19b30c | [
"Apache-2.0"
] | 4 | 2019-02-02T16:50:48.000Z | 2020-10-29T03:10:58.000Z | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain... | 33.310771 | 103 | 0.576679 | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain... | 38,472 | 0 | 396 |
498c63be36c0b6a32ef35460a5eb151ff42629e8 | 11,953 | py | Python | Regression/Combined.py | Maelstrom6/MachineLearning3 | cb9a327f998ed2d76d1b9cbcb96e970435a0f17d | [
"MIT"
] | null | null | null | Regression/Combined.py | Maelstrom6/MachineLearning3 | cb9a327f998ed2d76d1b9cbcb96e970435a0f17d | [
"MIT"
] | null | null | null | Regression/Combined.py | Maelstrom6/MachineLearning3 | cb9a327f998ed2d76d1b9cbcb96e970435a0f17d | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import time
import math
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import LabelEncoder, OneHotEncoder, StandardScaler
from ... | 34.546243 | 116 | 0.656823 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import time
import math
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import LabelEncoder, OneHotEncoder, StandardScaler
from ... | 261 | 7 | 103 |
0af4927eee31aba3c04d0fa0d722bfb98da68cc7 | 98,487 | py | Python | ck/repo/module/env/module.py | krai/ck | b6ab43c971dd910c93febce14e751ee40bd6e975 | [
"ECL-2.0",
"Apache-2.0"
] | 480 | 2015-02-04T16:07:43.000Z | 2021-08-17T13:47:53.000Z | ck/repo/module/env/module.py | krai/ck | b6ab43c971dd910c93febce14e751ee40bd6e975 | [
"ECL-2.0",
"Apache-2.0"
] | 166 | 2015-02-05T16:03:52.000Z | 2021-08-16T14:21:58.000Z | ck/repo/module/env/module.py | krai/ck | b6ab43c971dd910c93febce14e751ee40bd6e975 | [
"ECL-2.0",
"Apache-2.0"
] | 62 | 2015-02-05T17:21:14.000Z | 2021-09-05T10:24:53.000Z | #
# Collective Knowledge (environment)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal dat... | 34.739683 | 157 | 0.485089 | #
# Collective Knowledge (environment)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal dat... | 1,416 | 0 | 69 |
f8e521fe0cef05ac8906ee716c2e5465af27f7e9 | 1,119 | py | Python | old_town_road/migrations/0001_initial.py | PopeyeTheSailorsCat/RShinyFun | 368c1cb08489271f0a21e407e6e4e13b6f09b04c | [
"MIT"
] | null | null | null | old_town_road/migrations/0001_initial.py | PopeyeTheSailorsCat/RShinyFun | 368c1cb08489271f0a21e407e6e4e13b6f09b04c | [
"MIT"
] | 1 | 2021-05-19T16:46:57.000Z | 2021-05-19T16:46:57.000Z | old_town_road/migrations/0001_initial.py | PopeyeTheSailorsCat/RShinyFun | 368c1cb08489271f0a21e407e6e4e13b6f09b04c | [
"MIT"
] | 3 | 2021-05-19T16:44:43.000Z | 2021-05-31T19:29:44.000Z | # Generated by Django 3.2 on 2021-05-10 16:23
import django.contrib.postgres.fields
from django.db import migrations, models
| 32.911765 | 117 | 0.577301 | # Generated by Django 3.2 on 2021-05-10 16:23
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
... | 0 | 969 | 23 |
d52dc37cde9f7b41a832d210376b1c0df917bd89 | 2,948 | py | Python | modules/my_embedding.py | baoyujing/multi_gras | 1bc9b72bee786f5a439c1119a86b6ebaa19bf9f9 | [
"MIT"
] | null | null | null | modules/my_embedding.py | baoyujing/multi_gras | 1bc9b72bee786f5a439c1119a86b6ebaa19bf9f9 | [
"MIT"
] | null | null | null | modules/my_embedding.py | baoyujing/multi_gras | 1bc9b72bee786f5a439c1119a86b6ebaa19bf9f9 | [
"MIT"
] | null | null | null | import torch
import logging
import numpy as np
from data_management.vocabulary import Vocabulary
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
| 34.27907 | 110 | 0.627883 | import torch
import logging
import numpy as np
from data_management.vocabulary import Vocabulary
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class MyEmbedding:
def __init__(self, configs, vocabulary):
self.configs = self.default_configs()
self.configs.update(conf... | 1,596 | 1,128 | 46 |
71835bf60b98075ff89ca29513d3b23243af4b10 | 6,030 | py | Python | src/data/sroie/t5_ocr_baseline.py | marcospiau/final_project_ia376j | 2adfb147871be0259f16d472d527f3d2ea8a6ef5 | [
"MIT"
] | null | null | null | src/data/sroie/t5_ocr_baseline.py | marcospiau/final_project_ia376j | 2adfb147871be0259f16d472d527f3d2ea8a6ef5 | [
"MIT"
] | null | null | null | src/data/sroie/t5_ocr_baseline.py | marcospiau/final_project_ia376j | 2adfb147871be0259f16d472d527f3d2ea8a6ef5 | [
"MIT"
] | null | null | null | from IPython.display import Image as Image_py
from src.data.google_vision_ocr_parsing import extract_full_text_annotation
from src.data.sroie import load_full_ocr, load_labels
from torch.utils.data import Dataset, ConcatDataset
from transformers import T5Tokenizer
from typing import List, Dict, Union
import gin
class... | 37.924528 | 147 | 0.654063 | from IPython.display import Image as Image_py
from src.data.google_vision_ocr_parsing import extract_full_text_annotation
from src.data.sroie import load_full_ocr, load_labels
from torch.utils.data import Dataset, ConcatDataset
from transformers import T5Tokenizer
from typing import List, Dict, Union
import gin
class... | 2,359 | 0 | 133 |
32f3ee5c0ef514e71bee063ab5228653c208d83d | 305 | py | Python | shop/inventory/views.py | JAXPARROW/Simple-Shop-Management-System | 3f7863a604c2d476ffd6b7e992c852d8d6a38ece | [
"MIT"
] | null | null | null | shop/inventory/views.py | JAXPARROW/Simple-Shop-Management-System | 3f7863a604c2d476ffd6b7e992c852d8d6a38ece | [
"MIT"
] | 4 | 2020-06-05T23:14:57.000Z | 2022-02-10T08:23:16.000Z | shop/inventory/views.py | JAXPARROW/Simple-Shop-Management-System | 3f7863a604c2d476ffd6b7e992c852d8d6a38ece | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from inventory.models import Product
| 30.5 | 45 | 0.754098 | from django.shortcuts import render
from django.http import HttpResponse
from inventory.models import Product
def index(request):
template = "inventory/index.html"
product_list = Product.objects.all()
context = {'product_list': product_list}
return render(request, template, context)
| 168 | 0 | 23 |
d4c947b4f2e6cd38037898bac2d367cd3b37bb81 | 986 | py | Python | shadowproxy/proxies/base/udpclient.py | xiaoshihu/shadowproxy | 15e5669136dc6d4720aa54dcc5ff1c6839304767 | [
"MIT"
] | 180 | 2017-02-24T15:18:11.000Z | 2022-03-19T22:11:15.000Z | shadowproxy/proxies/base/udpclient.py | xiaoshihu/shadowproxy | 15e5669136dc6d4720aa54dcc5ff1c6839304767 | [
"MIT"
] | 9 | 2018-06-22T05:34:20.000Z | 2021-06-15T13:45:35.000Z | shadowproxy/proxies/base/udpclient.py | xiaoshihu/shadowproxy | 15e5669136dc6d4720aa54dcc5ff1c6839304767 | [
"MIT"
] | 45 | 2017-11-10T03:17:12.000Z | 2022-01-21T01:19:37.000Z | import curio
from curio import socket
from ... import gvars
| 27.388889 | 73 | 0.579108 | import curio
from curio import socket
from ... import gvars
class UDPClient:
def __init__(self, ns=None):
self.ns = ns
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
if "source_addr" in self.ns:
self.sock.bind(self.ns["source_addr"])
self._task = None
... | 772 | -5 | 157 |
436fe55c02a0947a16385203ac1051575f931ab3 | 1,208 | py | Python | test/test_consumer.py | timgates42/kafka-python | 3861e16ea4ef8d60bc6ffc51c0183da33c629642 | [
"Apache-2.0"
] | 4,389 | 2015-06-12T06:00:10.000Z | 2022-03-31T20:41:42.000Z | test/test_consumer.py | timgates42/kafka-python | 3861e16ea4ef8d60bc6ffc51c0183da33c629642 | [
"Apache-2.0"
] | 1,595 | 2015-12-02T20:58:22.000Z | 2022-03-27T07:28:03.000Z | test/test_consumer.py | timgates42/kafka-python | 3861e16ea4ef8d60bc6ffc51c0183da33c629642 | [
"Apache-2.0"
] | 1,115 | 2015-12-02T23:17:52.000Z | 2022-03-30T03:34:29.000Z | import pytest
from kafka import KafkaConsumer
from kafka.errors import KafkaConfigurationError
| 44.740741 | 149 | 0.749172 | import pytest
from kafka import KafkaConsumer
from kafka.errors import KafkaConfigurationError
class TestKafkaConsumer:
def test_session_timeout_larger_than_request_timeout_raises(self):
with pytest.raises(KafkaConfigurationError):
KafkaConsumer(bootstrap_servers='localhost:9092', api_version... | 978 | 3 | 130 |
fb6f3a9a3c03b87866598b7e85a581981e335dc9 | 2,041 | py | Python | setup.py | yunhailuo/pulsarpy-to-encodedcc | 9fd0ce2b81b502dbd2e1e39910f373bd9635f787 | [
"MIT"
] | null | null | null | setup.py | yunhailuo/pulsarpy-to-encodedcc | 9fd0ce2b81b502dbd2e1e39910f373bd9635f787 | [
"MIT"
] | null | null | null | setup.py | yunhailuo/pulsarpy-to-encodedcc | 9fd0ce2b81b502dbd2e1e39910f373bd9635f787 | [
"MIT"
] | 1 | 2020-02-21T18:09:12.000Z | 2020-02-21T18:09:12.000Z | # -*- coding: utf-8 -*-
###
# © 2018... | 37.109091 | 103 | 0.536502 | # -*- coding: utf-8 -*-
###
# © 2018... | 0 | 0 | 0 |
f670c54285d8971823c43970d248f92bafe9616f | 276 | py | Python | dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_persistent_2.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_persistent_2.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_persistent_2.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | #py_persistent_2.py
"""pickle your stuff for a long winter's nap"""
import pickle
from py_persistent_3 import THIS_YEAR
print("imported THIS_YEAR, which is {}".format(THIS_YEAR))
pickle_file='this_year.pkl'
with open(pickle_file, 'wb') as f:
pickle.dump(THIS_YEAR, f)
| 21.230769 | 58 | 0.75 | #py_persistent_2.py
"""pickle your stuff for a long winter's nap"""
import pickle
from py_persistent_3 import THIS_YEAR
print("imported THIS_YEAR, which is {}".format(THIS_YEAR))
pickle_file='this_year.pkl'
with open(pickle_file, 'wb') as f:
pickle.dump(THIS_YEAR, f)
| 0 | 0 | 0 |
2b714739a20546647333e9e1addeecafdc2bcc70 | 1,556 | py | Python | machine/qemu/sources/u-boot/tools/buildman/main.py | muddessir/framework | 5b802b2dd7ec9778794b078e748dd1f989547265 | [
"MIT"
] | 1 | 2021-11-21T19:56:29.000Z | 2021-11-21T19:56:29.000Z | machine/qemu/sources/u-boot/tools/buildman/main.py | muddessir/framework | 5b802b2dd7ec9778794b078e748dd1f989547265 | [
"MIT"
] | null | null | null | machine/qemu/sources/u-boot/tools/buildman/main.py | muddessir/framework | 5b802b2dd7ec9778794b078e748dd1f989547265 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0+
#
# Copyright (c) 2012 The Chromium OS Authors.
#
"""See README for more information"""
import doctest
import multiprocessing
import os
import re
import sys
import unittest
# Bring in the patman libraries
our_path = os.path.dirname(os.path.realpath(__file__)... | 23.575758 | 67 | 0.728149 | #!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0+
#
# Copyright (c) 2012 The Chromium OS Authors.
#
"""See README for more information"""
import doctest
import multiprocessing
import os
import re
import sys
import unittest
# Bring in the patman libraries
our_path = os.path.dirname(os.path.realpath(__file__)... | 604 | 0 | 23 |
e2424a6dc8fee72b13c7a7a3830acad197cad4f3 | 904 | py | Python | python/LAC/tests/lac_test.py | Nickname1230/lac | fceeee966f93896bfc20c5eb2d7134df5f37f2f0 | [
"Apache-2.0"
] | 3,032 | 2018-07-02T13:51:54.000Z | 2022-03-31T13:28:56.000Z | python/LAC/tests/lac_test.py | DefTruth/lac | 9d8fef31252fc9da9531036c2478c3b54ab97cc0 | [
"Apache-2.0"
] | 210 | 2018-07-04T14:20:58.000Z | 2022-03-26T05:38:36.000Z | python/LAC/tests/lac_test.py | DefTruth/lac | 9d8fef31252fc9da9531036c2478c3b54ab97cc0 | [
"Apache-2.0"
] | 527 | 2018-07-03T11:11:36.000Z | 2022-03-30T08:01:44.000Z | from LAC import LAC
"""
本文件测试LAC的分词,词性标注及重要性功能
"""
os.environ['PYTHONIOENCODING'] = 'UTF-8'
| 22.6 | 66 | 0.664823 | from LAC import LAC
"""
本文件测试LAC的分词,词性标注及重要性功能
"""
os.environ['PYTHONIOENCODING'] = 'UTF-8'
def fun_seg():
# 装载分词模型
lac = LAC("models_general/seg_model",mode='seg')
# 单个样本输入,输入为Unicode编码的字符串
text = u"LAC是个优秀的分词工具"
seg_result = lac.run(text)
print(seg_result)
# 批量样本输入, 输入为多个句子组成的list,平均速率会... | 960 | 0 | 92 |
48f4ad35905be0785e499a6bc4bbc4cf84e3ee62 | 2,834 | py | Python | main.py | nielsrowinbik/house-finder | 6cef57c0adae7611ea44eebfd207d760f0309b6e | [
"MIT"
] | null | null | null | main.py | nielsrowinbik/house-finder | 6cef57c0adae7611ea44eebfd207d760f0309b6e | [
"MIT"
] | null | null | null | main.py | nielsrowinbik/house-finder | 6cef57c0adae7611ea44eebfd207d760f0309b6e | [
"MIT"
] | null | null | null |
import time
import requests
import os
import json
from datetime import datetime
from dotenv import load_dotenv
from tinydb import TinyDB, where
from scrapers.domvast import Domvast
from scrapers.beumerutrecht import BeumerUtrecht
from scrapers.rvl import RVL
from scrapers.molenbeek import Molenbeek
from scrapers.mak... | 26 | 122 | 0.581863 |
import time
import requests
import os
import json
from datetime import datetime
from dotenv import load_dotenv
from tinydb import TinyDB, where
from scrapers.domvast import Domvast
from scrapers.beumerutrecht import BeumerUtrecht
from scrapers.rvl import RVL
from scrapers.molenbeek import Molenbeek
from scrapers.mak... | 1,897 | 0 | 46 |
709fefd2218972b770608f8a8bc148f6619f6ec4 | 13,312 | py | Python | Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py | RTSandberg/WarpX | 78d3d84649692d711baf5872f476bbe7522ae36c | [
"BSD-3-Clause-LBNL"
] | null | null | null | Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py | RTSandberg/WarpX | 78d3d84649692d711baf5872f476bbe7522ae36c | [
"BSD-3-Clause-LBNL"
] | null | null | null | Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py | RTSandberg/WarpX | 78d3d84649692d711baf5872f476bbe7522ae36c | [
"BSD-3-Clause-LBNL"
] | null | null | null | #!/usr/bin/env python3
#
# --- Copyright 2021 Modern Electron
# --- Monte-Carlo Collision script to reproduce the benchmark tests from
# --- Turner et al. (2013) - https://doi.org/10.1063/1.4775084
import argparse
import sys
import numpy as np
from pywarpx import callbacks, fields, picmi
from scipy.sparse import csc_... | 34.939633 | 88 | 0.533579 | #!/usr/bin/env python3
#
# --- Copyright 2021 Modern Electron
# --- Monte-Carlo Collision script to reproduce the benchmark tests from
# --- Turner et al. (2013) - https://doi.org/10.1063/1.4775084
import argparse
import sys
import numpy as np
from pywarpx import callbacks, fields, picmi
from scipy.sparse import csc_... | 569 | 0 | 54 |
4fd865b9d7893e89c06c22e96a9bd4855df4c3f2 | 5,433 | py | Python | torchkit/train_test.py | Gilf641/MODEST | 46d33e90c7bcb901cbfa184316bb756fb6300f3d | [
"MIT"
] | null | null | null | torchkit/train_test.py | Gilf641/MODEST | 46d33e90c7bcb901cbfa184316bb756fb6300f3d | [
"MIT"
] | null | null | null | torchkit/train_test.py | Gilf641/MODEST | 46d33e90c7bcb901cbfa184316bb756fb6300f3d | [
"MIT"
] | null | null | null | import torch
import torchvision
from tqdm import notebook
import torch.nn.functional as F
from time import time
| 35.279221 | 127 | 0.585128 | import torch
import torchvision
from tqdm import notebook
import torch.nn.functional as F
from time import time
class TrainModel:
def __init__(self, model, device, trainloader, optimizer, scheduler, mask_criterion):
self.model = model
self.device = device
self.trainloader = trainloader
... | 5,085 | -10 | 232 |
634dd77bd1ad12b917a8ab87a46ef491b4f574db | 2,487 | py | Python | crack.py | jabbalaci/fallout3_computer_hack | dcdb4dcbb31e147dd023ab1627ed2f458072a769 | [
"MIT"
] | null | null | null | crack.py | jabbalaci/fallout3_computer_hack | dcdb4dcbb31e147dd023ab1627ed2f458072a769 | [
"MIT"
] | null | null | null | crack.py | jabbalaci/fallout3_computer_hack | dcdb4dcbb31e147dd023ab1627ed2f458072a769 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
import sys
from itertools import combinations
from random import randint
##############################################################################
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: {} words.txt".format(sys.argv[0]))
... | 22.816514 | 85 | 0.492963 | #!/usr/bin/env python3
# encoding: utf-8
import sys
from itertools import combinations
from random import randint
def header():
N = 80
print("ROBCO INDUSTRIES UNIFIED OPERATING SYSTEM".center(N))
print("COPYRIGHT 2075-2077 ROBCO INDUSTRIES".center(N))
print("-Server {n}-".format(n=randint(1, 9)).cent... | 1,936 | 0 | 184 |
7ca0467ca7463121578de0541b5fc2511fca073f | 702 | py | Python | fiteos/io/read_csv.py | lanl/fiteos | 9717f92f9453331530fe5390e402c85ff771a28f | [
"BSD-3-Clause",
"Unlicense"
] | 1 | 2021-12-23T18:52:29.000Z | 2021-12-23T18:52:29.000Z | fiteos/io/read_csv.py | lanl/fiteos | 9717f92f9453331530fe5390e402c85ff771a28f | [
"BSD-3-Clause",
"Unlicense"
] | 1 | 2020-08-03T14:58:27.000Z | 2020-08-03T15:05:29.000Z | fiteos/io/read_csv.py | lanl/fiteos | 9717f92f9453331530fe5390e402c85ff771a28f | [
"BSD-3-Clause",
"Unlicense"
] | null | null | null | """ This module contains functions for reading CSV files containing pressure
and volume data.
"""
import numpy
def read_csv(input_file, delimiter=",", x="p", sigma_x="sigma_p",
y="v", sigma_y="sigma_v"):
"""
Reads a CSV file with x and y data and standard deviation columns.
Parameters
... | 25.071429 | 76 | 0.608262 | """ This module contains functions for reading CSV files containing pressure
and volume data.
"""
import numpy
def read_csv(input_file, delimiter=",", x="p", sigma_x="sigma_p",
y="v", sigma_y="sigma_v"):
"""
Reads a CSV file with x and y data and standard deviation columns.
Parameters
... | 0 | 0 | 0 |
5f06a2a57bc2684be74eec00d4f61a4092341f5b | 2,985 | py | Python | data.py | edouard-harris/alignment-experiment-definition | 230f4c0f6bc0689ce7da0d10050f6d74ad2ea122 | [
"MIT"
] | null | null | null | data.py | edouard-harris/alignment-experiment-definition | 230f4c0f6bc0689ce7da0d10050f6d74ad2ea122 | [
"MIT"
] | null | null | null | data.py | edouard-harris/alignment-experiment-definition | 230f4c0f6bc0689ce7da0d10050f6d74ad2ea122 | [
"MIT"
] | null | null | null | import fastai.torch_core as tc
import fastai.data.load as load
import torch
import PIL as pil
import pathlib as path
import dill
from numpy import prod
import utils
################################################################################
TARGET_FOLDER = 'data'
DATA_PATH = utils.download_dataset('cifar10', T... | 35.117647 | 133 | 0.665662 | import fastai.torch_core as tc
import fastai.data.load as load
import torch
import PIL as pil
import pathlib as path
import dill
from numpy import prod
import utils
################################################################################
TARGET_FOLDER = 'data'
DATA_PATH = utils.download_dataset('cifar10', T... | 2,305 | 0 | 115 |
e9d14eaf05e42b5364baae6f35196c51f9d60b1e | 577 | py | Python | problem_36.py | alfonsokim/project-euler | cdc5a271c22f3ad78681ac920f2d9be6e75cdbc5 | [
"Unlicense"
] | null | null | null | problem_36.py | alfonsokim/project-euler | cdc5a271c22f3ad78681ac920f2d9be6e75cdbc5 | [
"Unlicense"
] | null | null | null | problem_36.py | alfonsokim/project-euler | cdc5a271c22f3ad78681ac920f2d9be6e75cdbc5 | [
"Unlicense"
] | null | null | null |
# =======================================================================================
# =======================================================================================
# =======================================================================================
if __name__ == '__main__':
solve() | 33.941176 | 89 | 0.331023 |
# =======================================================================================
def is_palindrome(a_str):
return a_str == a_str[::-1]
# =======================================================================================
def solve():
a_sum = 0
for i in range(1, 1000000, 2):
both_palin... | 221 | 0 | 44 |
c4a07749bee534c0e70b32c6869cadae8810f875 | 2,635 | py | Python | tests/test_learn_to_add_digits.py | namin/d4 | 64ced093c44e2e391fd1d6561e431d538e05d499 | [
"MIT"
] | 42 | 2018-02-05T22:32:06.000Z | 2019-08-14T14:08:44.000Z | tests/test_learn_to_add_digits.py | namin/d4 | 64ced093c44e2e391fd1d6561e431d538e05d499 | [
"MIT"
] | null | null | null | tests/test_learn_to_add_digits.py | namin/d4 | 64ced093c44e2e391fd1d6561e431d538e05d499 | [
"MIT"
] | 9 | 2018-02-07T08:50:32.000Z | 2019-03-20T06:50:51.000Z | import logging
import tensorflow as tf
import d4.dsm.extensible_dsm as edsm
import d4.interpreter as si
from d4.dsm.loss import L2Loss
logging.basicConfig(level=logging.DEBUG)
if __name__ == "__main__":
test_learn_to_add_digits()
| 35.608108 | 115 | 0.575332 | import logging
import tensorflow as tf
import d4.dsm.extensible_dsm as edsm
import d4.interpreter as si
from d4.dsm.loss import L2Loss
logging.basicConfig(level=logging.DEBUG)
def test_learn_to_add_digits():
batch_size = 1
interpreter = si.SimpleInterpreter(3, 20, 15, batch_size,
... | 2,373 | 0 | 23 |
87226d5dde8b07e09235bcd2bcad4eadfa123399 | 2,136 | py | Python | app/auth.py | kgantsov/shopping_list | cc71ed8c1535c9360bb2c955e29cb7c28f3c8161 | [
"MIT"
] | null | null | null | app/auth.py | kgantsov/shopping_list | cc71ed8c1535c9360bb2c955e29cb7c28f3c8161 | [
"MIT"
] | null | null | null | app/auth.py | kgantsov/shopping_list | cc71ed8c1535c9360bb2c955e29cb7c28f3c8161 | [
"MIT"
] | null | null | null | from datetime import datetime
from datetime import timedelta
import jwt
from jwt import PyJWTError
from passlib.context import CryptContext
from fastapi import Depends
from fastapi import HTTPException
from fastapi.security import HTTPBearer
from starlette.status import HTTP_401_UNAUTHORIZED
from app.models.auth im... | 27.037975 | 87 | 0.742509 | from datetime import datetime
from datetime import timedelta
import jwt
from jwt import PyJWTError
from passlib.context import CryptContext
from fastapi import Depends
from fastapi import HTTPException
from fastapi.security import HTTPBearer
from starlette.status import HTTP_401_UNAUTHORIZED
from app.models.auth im... | 1,403 | 0 | 138 |
a22e424630255df4225586eeb9f0d62a03d5318f | 4,285 | py | Python | test/test_misc.py | xywei/loopy | f176bc70ef52862ee0dfcc661fbe4b86b1726f55 | [
"MIT"
] | null | null | null | test/test_misc.py | xywei/loopy | f176bc70ef52862ee0dfcc661fbe4b86b1726f55 | [
"MIT"
] | null | null | null | test/test_misc.py | xywei/loopy | f176bc70ef52862ee0dfcc661fbe4b86b1726f55 | [
"MIT"
] | null | null | null | from __future__ import division, absolute_import, print_function
__copyright__ = "Copyright (C) 2016 Matt Wala"
__license__ = """
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 restricti... | 27.645161 | 78 | 0.649242 | from __future__ import division, absolute_import, print_function
__copyright__ = "Copyright (C) 2016 Matt Wala"
__license__ = """
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 restricti... | 2,625 | 95 | 92 |
a2e6ae5a2f78d5e7a8b7911933762cb466cb16d5 | 12,257 | py | Python | forms/models.py | digideskio/gmmp | d82a4be0787c3a3a9e27dc590d7974f9f884fbb6 | [
"Apache-2.0"
] | 2 | 2015-04-02T23:09:03.000Z | 2015-12-03T00:19:06.000Z | forms/models.py | digideskio/gmmp | d82a4be0787c3a3a9e27dc590d7974f9f884fbb6 | [
"Apache-2.0"
] | 13 | 2015-04-01T07:39:43.000Z | 2015-08-26T06:24:07.000Z | forms/models.py | OpenUpSA/gmmp | d82a4be0787c3a3a9e27dc590d7974f9f884fbb6 | [
"Apache-2.0"
] | 2 | 2019-07-25T11:53:10.000Z | 2020-06-22T02:07:40.000Z | from collections import OrderedDict
from django.db import models
from django.utils.translation import ugettext_lazy as _
from modelutils import *
sheet_models = OrderedDict([
('Print', NewspaperSheet),
('Radio', RadioSheet),
('Television', TelevisionSheet),
('Internet', InternetNewsSheet),
('Twit... | 38.303125 | 301 | 0.707025 | from collections import OrderedDict
from django.db import models
from django.utils.translation import ugettext_lazy as _
from modelutils import *
def prepend_verbose(mydict, field_name, num):
field = mydict[field_name]
field.verbose_name = '(%s) %s' % (num, field_name)
class InternetNewsJournalist(Journalist... | 1,521 | 8,512 | 460 |
22761e5bc23f4a2d3a9ddfe31e6568540a181b11 | 3,039 | py | Python | backend/shop/api.py | reyx7/nearby_shops | bb0f622752b171d75778c499053740a4662024fd | [
"MIT"
] | null | null | null | backend/shop/api.py | reyx7/nearby_shops | bb0f622752b171d75778c499053740a4662024fd | [
"MIT"
] | 1 | 2018-11-27T22:59:52.000Z | 2018-11-28T22:18:28.000Z | backend/shop/api.py | reyx7/nearby_shops | bb0f622752b171d75778c499053740a4662024fd | [
"MIT"
] | null | null | null | from graphene_django import DjangoObjectType
from graphql_jwt.decorators import login_required
import graphene
from .models import *
class ShopType(DjangoObjectType):
"""
Create ModelType for Shop model
"""
class Meta:
"""
Metadata class
"""
model = Shop
cla... | 20.125828 | 68 | 0.577822 | from graphene_django import DjangoObjectType
from graphql_jwt.decorators import login_required
import graphene
from .models import *
class ShopType(DjangoObjectType):
"""
Create ModelType for Shop model
"""
class Meta:
"""
Metadata class
"""
model = Shop
cla... | 209 | 0 | 52 |
672696afa804b9a6050a954424e831ec25cc0bff | 372 | py | Python | users/admin.py | mohilkhare1708/descriptiveAnswerChecker | 839404e807f884afd8b59e6f2eebfbc8b1189e83 | [
"MIT"
] | 2 | 2021-02-15T20:50:47.000Z | 2022-02-14T18:31:30.000Z | users/admin.py | mohilkhare1708/descriptiveAnswerChecker | 839404e807f884afd8b59e6f2eebfbc8b1189e83 | [
"MIT"
] | null | null | null | users/admin.py | mohilkhare1708/descriptiveAnswerChecker | 839404e807f884afd8b59e6f2eebfbc8b1189e83 | [
"MIT"
] | 1 | 2022-01-11T15:10:50.000Z | 2022-01-11T15:10:50.000Z | from django.contrib import admin
from users import models
# Register your models here.
admin.site.register(models.Profile, ProfileAdmin) | 31 | 68 | 0.709677 | from django.contrib import admin
from users import models
# Register your models here.
class ProfileAdmin(admin.ModelAdmin):
list_display = ('id', 'user','full_name', 'email', 'phone')
list_display_links = ('id','user','full_name', 'email', 'phone')
search_fields = ('id','full_name')
list_per_page = 2... | 0 | 211 | 23 |
f1c75bdada7e9677a3a28d5292c81635c62e5b25 | 1,419 | py | Python | tf_lassonet/proximal.py | ADeGobbis/TF_LassoNet | 9c6cb9e0d8800ab32e35ddf5e35d20974963bcfd | [
"MIT"
] | 2 | 2021-09-24T08:46:51.000Z | 2021-10-02T01:31:23.000Z | tf_lassonet/proximal.py | lucianolorenti/TF_LassoNet | 01f4720fa3c698731280703ae930164a67750b5b | [
"MIT"
] | null | null | null | tf_lassonet/proximal.py | lucianolorenti/TF_LassoNet | 01f4720fa3c698731280703ae930164a67750b5b | [
"MIT"
] | null | null | null | import tensorflow as tf
| 27.823529 | 93 | 0.598309 | import tensorflow as tf
def tf_soft_threshold(l, x):
return tf.sign(x) * tf.nn.relu(tf.abs(x) - l)
def tf_sign_binary(x):
ones = tf.ones_like(x)
return tf.where(x >= 0, ones, -ones)
def hier_prox_group(skip, W, *, lambda_, M, lambda_bar=0):
n_features, output_size = W.shape
zeros = tf.zeros((n... | 1,324 | 0 | 69 |
adf5547cf891b6ceb7adeb11cb22225f8e1109d2 | 480 | py | Python | war/__init__.py | clausserg/war | 409f6d3783c6b1e4e2cb23bd0ce16d3417ca914b | [
"BSD-3-Clause"
] | null | null | null | war/__init__.py | clausserg/war | 409f6d3783c6b1e4e2cb23bd0ce16d3417ca914b | [
"BSD-3-Clause"
] | null | null | null | war/__init__.py | clausserg/war | 409f6d3783c6b1e4e2cb23bd0ce16d3417ca914b | [
"BSD-3-Clause"
] | null | null | null | """
war
War card game written for fun while following the 'Complete Python Developer Certification Course' by Imtiaz Ahmad, on Udemy.
"""
# Add imports here
# from card_class import Card
# from .deck_class import Deck
# from .table_class import Table
# from .functions import get_players
# Handle versioneer
from ._ve... | 25.263158 | 125 | 0.785417 | """
war
War card game written for fun while following the 'Complete Python Developer Certification Course' by Imtiaz Ahmad, on Udemy.
"""
# Add imports here
# from card_class import Card
# from .deck_class import Deck
# from .table_class import Table
# from .functions import get_players
# Handle versioneer
from ._ve... | 0 | 0 | 0 |
63fafe461071d59d6e10491c23fcbf0afe3f53a6 | 5,109 | py | Python | ledfxcontroller/api/websocket.py | Aircoookie/LedFx | 95628fc237497dd89aaf30fdbf88f780f3330166 | [
"MIT"
] | 17 | 2018-08-31T05:51:09.000Z | 2022-02-12T15:41:33.000Z | ledfxcontroller/api/websocket.py | Aircoookie/LedFx | 95628fc237497dd89aaf30fdbf88f780f3330166 | [
"MIT"
] | null | null | null | ledfxcontroller/api/websocket.py | Aircoookie/LedFx | 95628fc237497dd89aaf30fdbf88f780f3330166 | [
"MIT"
] | 5 | 2019-07-15T22:12:45.000Z | 2022-02-05T10:50:44.000Z | import json
import logging
import asyncio
from aiohttp import web
import voluptuous as vol
from concurrent import futures
from ledfxcontroller.api import RestEndpoint
_LOGGER = logging.getLogger(__name__)
MAX_PENDING_MESSAGES = 256
BASE_MESSAGE_SCHEMA = vol.Schema({
vol.Required('id'): vol.Coerce(int),
vol.Re... | 32.75 | 137 | 0.61695 | import json
import logging
import asyncio
from aiohttp import web
import voluptuous as vol
from concurrent import futures
from ledfxcontroller.api import RestEndpoint
_LOGGER = logging.getLogger(__name__)
MAX_PENDING_MESSAGES = 256
BASE_MESSAGE_SCHEMA = vol.Schema({
vol.Required('id'): vol.Coerce(int),
vol.Re... | 1,061 | 3,264 | 90 |
1f46a9df79c3b0f6594612a843c5543d05969797 | 2,021 | py | Python | Some Small Opencv Projects/Motion Detector.py | ajay-panchal-099/Project | 3064bb85cbaece47cc9aff24379ea8b04480663a | [
"MIT"
] | null | null | null | Some Small Opencv Projects/Motion Detector.py | ajay-panchal-099/Project | 3064bb85cbaece47cc9aff24379ea8b04480663a | [
"MIT"
] | null | null | null | Some Small Opencv Projects/Motion Detector.py | ajay-panchal-099/Project | 3064bb85cbaece47cc9aff24379ea8b04480663a | [
"MIT"
] | null | null | null | # step 1 - capture first frame
# step 2 - capture other frame
# step 3 - calculate the difference in frisr and other frame
# step 4 - define threshold
# step 5 - define boarders
import cv2
from sendMail import send_mail
from datetime import datetime
first_frame = None
video = cv2.VideoCapture(0)
count ... | 28.069444 | 98 | 0.598219 | # step 1 - capture first frame
# step 2 - capture other frame
# step 3 - calculate the difference in frisr and other frame
# step 4 - define threshold
# step 5 - define boarders
import cv2
from sendMail import send_mail
from datetime import datetime
first_frame = None
video = cv2.VideoCapture(0)
count ... | 0 | 0 | 0 |
a559b68e6e258e5bc7f246aeb91e4103d25e84d1 | 537 | py | Python | microsoft_student_partners/msp/urls.py | dntandan/Microsoft-Student-Partners | e694678b0d70f6484a8715159dbb61a8030961cc | [
"MIT"
] | 15 | 2020-04-11T17:56:30.000Z | 2021-11-07T20:38:49.000Z | microsoft_student_partners/msp/urls.py | dntandan/Microsoft-Student-Partners | e694678b0d70f6484a8715159dbb61a8030961cc | [
"MIT"
] | 23 | 2020-04-12T06:20:49.000Z | 2020-08-09T05:34:45.000Z | microsoft_student_partners/msp/urls.py | dntandan/Microsoft-Student-Partners | e694678b0d70f6484a8715159dbb61a8030961cc | [
"MIT"
] | 28 | 2020-04-11T18:22:33.000Z | 2020-05-08T17:09:52.000Z | from django.urls import path
from django.views.generic.base import TemplateView
from microsoft_student_partners.msp.views import MspView
app_name = "msp"
urlpatterns = [
path("", view=MspView.as_view(), name="home"),
path(
"services/",
TemplateView.as_view(template_name="services.html"),
... | 28.263158 | 86 | 0.675978 | from django.urls import path
from django.views.generic.base import TemplateView
from microsoft_student_partners.msp.views import MspView
app_name = "msp"
urlpatterns = [
path("", view=MspView.as_view(), name="home"),
path(
"services/",
TemplateView.as_view(template_name="services.html"),
... | 0 | 0 | 0 |
90ae2a2ffbb780a2c129edcfc5baba156b926be9 | 1,715 | py | Python | lztools/third/git.py | Zanzes/lztools | 4091416464cbb441f5af26ade6a03ff18ae1bf01 | [
"MIT"
] | null | null | null | lztools/third/git.py | Zanzes/lztools | 4091416464cbb441f5af26ade6a03ff18ae1bf01 | [
"MIT"
] | null | null | null | lztools/third/git.py | Zanzes/lztools | 4091416464cbb441f5af26ade6a03ff18ae1bf01 | [
"MIT"
] | null | null | null | from collections import namedtuple
from datetime import datetime
from subprocess import call
GitFileData = namedtuple("GitFileData", ["permissions", "type", "hash", "path"])
repos = dict()
def load_file(repo, file:GitFileData):
"""git checkout HEAD -- {path}"""
try:
get_repo(repo).checkout("master", ... | 31.759259 | 100 | 0.602915 | from collections import namedtuple
from datetime import datetime
from subprocess import call
GitFileData = namedtuple("GitFileData", ["permissions", "type", "hash", "path"])
repos = dict()
def get_repo(path):
if path not in repos:
repos[path] = sh.git.bake(_cwd=path)
return repos[path]
def save_file... | 430 | 0 | 69 |
eca233777f2bdc6c3f71e80474c1561cba6e0f68 | 1,621 | py | Python | Flask API Connection - Violin/app.py | LaurenPrins/Project2-RPIComparison | 8b2bb02e6777a99815e76b6d4442d16e75b61cde | [
"Apache-2.0"
] | null | null | null | Flask API Connection - Violin/app.py | LaurenPrins/Project2-RPIComparison | 8b2bb02e6777a99815e76b6d4442d16e75b61cde | [
"Apache-2.0"
] | null | null | null | Flask API Connection - Violin/app.py | LaurenPrins/Project2-RPIComparison | 8b2bb02e6777a99815e76b6d4442d16e75b61cde | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from password import pw
import json
from flask import Flask, jsonify, render_template
path = 'postgresql://postgres:' + pw + '@localhost:5432/rpi_comp'
engine = create_engine(path)
conn ... | 20.782051 | 76 | 0.666255 | import pandas as pd
import numpy as np
import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from password import pw
import json
from flask import Flask, jsonify, render_template
path = 'postgresql://postgres:' + pw + '@localhost:5432/rpi_comp'
engine = create_engine(path)
conn ... | 155 | 0 | 47 |
1f327aaa4170f7c10c3bf08fe4d3fbf27e8a3455 | 1,232 | py | Python | hijack_admin/tests/test_hijack_admin.py | andyzickler/django-hijack-admin | 934b2b94defe2986f66642bd60238cf752db8803 | [
"MIT"
] | 69 | 2016-05-06T07:08:38.000Z | 2020-11-25T10:09:56.000Z | hijack_admin/tests/test_hijack_admin.py | andyzickler/django-hijack-admin | 934b2b94defe2986f66642bd60238cf752db8803 | [
"MIT"
] | 35 | 2016-04-15T05:11:28.000Z | 2020-12-21T20:13:23.000Z | hijack_admin/tests/test_hijack_admin.py | andyzickler/django-hijack-admin | 934b2b94defe2986f66642bd60238cf752db8803 | [
"MIT"
] | 29 | 2016-04-15T05:07:18.000Z | 2020-10-10T08:42:21.000Z | # -*- coding: utf-8 -*-
from hijack.tests.test_hijack import BaseHijackTests
from hijack_admin import settings as hijack_admin_settings
from hijack_admin.tests.test_app.models import RelatedModel
| 41.066667 | 110 | 0.732143 | # -*- coding: utf-8 -*-
from hijack.tests.test_hijack import BaseHijackTests
from hijack_admin import settings as hijack_admin_settings
from hijack_admin.tests.test_app.models import RelatedModel
class HijackAdminTests(BaseHijackTests):
def setUp(self):
super(HijackAdminTests, self).setUp()
def tea... | 857 | 19 | 158 |
8708fd20e46a28e8d584553223c3038b77fd870c | 11,156 | py | Python | pyedbglib/protocols/jtagice3protocol.py | mraardvark/pyedbglib | 9774cf82787e37ef211faaa8cf00e2a8b7eaa7e0 | [
"MIT"
] | 10 | 2018-10-27T11:49:18.000Z | 2021-04-06T02:21:15.000Z | pyedbglib/protocols/jtagice3protocol.py | mraardvark/pyedbglib | 9774cf82787e37ef211faaa8cf00e2a8b7eaa7e0 | [
"MIT"
] | 1 | 2021-03-14T15:49:32.000Z | 2021-03-14T17:59:43.000Z | pyedbglib/protocols/jtagice3protocol.py | mraardvark/pyedbglib | 9774cf82787e37ef211faaa8cf00e2a8b7eaa7e0 | [
"MIT"
] | null | null | null | """JTAGICE3 protocol mappings"""
from logging import getLogger
from .avrcmsisdap import AvrCommand
from ..util import binary
from ..util import print_helpers
from ..pyedbglib_errors import PyedbglibError
class Jtagice3Command(AvrCommand):
"""
Sends a "JTAGICE3" command frame, and received a response
... | 33.005917 | 119 | 0.612854 | """JTAGICE3 protocol mappings"""
from logging import getLogger
from .avrcmsisdap import AvrCommand
from ..util import binary
from ..util import print_helpers
from ..pyedbglib_errors import PyedbglibError
class Jtagice3Command(AvrCommand):
"""
Sends a "JTAGICE3" command frame, and received a response
... | 629 | 0 | 81 |
059e0cc687ad91a76d6fe98f7dcf506b27c8b809 | 2,260 | py | Python | spec/profiles/dragger_spec.py | gisce/enerdata | 05a4afe61f20dcbcff070c71e96f6fd10955c216 | [
"MIT"
] | 7 | 2015-10-09T11:51:18.000Z | 2022-01-12T13:40:26.000Z | spec/profiles/dragger_spec.py | gisce/enerdata | 05a4afe61f20dcbcff070c71e96f6fd10955c216 | [
"MIT"
] | 93 | 2015-12-12T14:34:21.000Z | 2021-08-12T08:29:25.000Z | spec/profiles/dragger_spec.py | gisce/enerdata | 05a4afe61f20dcbcff070c71e96f6fd10955c216 | [
"MIT"
] | 5 | 2015-12-12T22:19:55.000Z | 2022-01-12T13:40:30.000Z | from decimal import Decimal
from enerdata.profiles.profile import *
from expects import *
with description('A dragger object'):
with it('must return the integer of the number'):
d = Dragger()
aprox = d.drag(32.453)
expect(aprox).to(be(32))
with it('must keep the decimal part'):
... | 34.242424 | 73 | 0.513274 | from decimal import Decimal
from enerdata.profiles.profile import *
from expects import *
with description('A dragger object'):
with it('must return the integer of the number'):
d = Dragger()
aprox = d.drag(32.453)
expect(aprox).to(be(32))
with it('must keep the decimal part'):
... | 0 | 0 | 0 |
b5bfe7730016f76f78aeda1c66899c9ae09f4472 | 1,330 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/NV/blend_square.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/NV/blend_square.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/NV/blend_square.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''OpenGL extension NV.blend_square
This module customises the behaviour of the
OpenGL.raw.GL.NV.blend_square to provide a more
Python-friendly API
Overview (from the spec)
It is useful to be able to multiply a number by itself in the blending
stages -- for example, in certain types of specular lightin... | 35.945946 | 73 | 0.780451 | '''OpenGL extension NV.blend_square
This module customises the behaviour of the
OpenGL.raw.GL.NV.blend_square to provide a more
Python-friendly API
Overview (from the spec)
It is useful to be able to multiply a number by itself in the blending
stages -- for example, in certain types of specular lightin... | 0 | 0 | 0 |
79e4b5d7744f735bc87dbe2f8b797031f5cdbd6d | 261 | py | Python | chainer/training/triggers/__init__.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | chainer/training/triggers/__init__.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | chainer/training/triggers/__init__.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | from chainer.training.triggers import interval
from chainer.training.triggers import minmax_value_trigger
IntervalTrigger = interval.IntervalTrigger
MaxValueTrigger = minmax_value_trigger.MaxValueTrigger
MinValueTrigger = minmax_value_trigger.MinValueTrigger
| 32.625 | 58 | 0.888889 | from chainer.training.triggers import interval
from chainer.training.triggers import minmax_value_trigger
IntervalTrigger = interval.IntervalTrigger
MaxValueTrigger = minmax_value_trigger.MaxValueTrigger
MinValueTrigger = minmax_value_trigger.MinValueTrigger
| 0 | 0 | 0 |
58c73ee2160235ee30a1f30f8cadaaff4c87fe20 | 996 | py | Python | Section 1/1.6/code.py | PacktPublishing/-Data-Wrangling-with-Python-3.x | 0273db00752a05e347e149d68decb45ed4778d2c | [
"MIT"
] | 16 | 2019-02-07T09:17:11.000Z | 2022-01-30T12:38:47.000Z | Section 1/1.6/code.py | PacktPublishing/-Data-Wrangling-with-Python-3.x | 0273db00752a05e347e149d68decb45ed4778d2c | [
"MIT"
] | 1 | 2019-07-06T15:36:28.000Z | 2019-07-06T15:36:28.000Z | Section 1/1.6/code.py | PacktPublishing/-Data-Wrangling-with-Python-3.x | 0273db00752a05e347e149d68decb45ed4778d2c | [
"MIT"
] | 15 | 2019-02-12T09:46:03.000Z | 2022-01-04T16:54:28.000Z | import urllib.request
wiki = "https://en.wikipedia.org/wiki/List_of_countries_by_the_number_of_billionaires"
page = urllib.request.urlopen(wiki)
from bs4 import BeautifulSoup
soup = BeautifulSoup(page)
print (soup.prettify())
soup.title.text
soup.a
soup.find_all("a")
right_table = soup.find('table',class_ = 'wiki... | 16.881356 | 88 | 0.646586 | import urllib.request
wiki = "https://en.wikipedia.org/wiki/List_of_countries_by_the_number_of_billionaires"
page = urllib.request.urlopen(wiki)
from bs4 import BeautifulSoup
soup = BeautifulSoup(page)
print (soup.prettify())
soup.title.text
soup.a
soup.find_all("a")
right_table = soup.find('table',class_ = 'wiki... | 0 | 0 | 0 |