max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
testcases/cloud_admin/services_up_test.py | tbeckham/eutester | 0 | 6300 | <gh_stars>0
#!/usr/bin/python
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
... | #!/usr/bin/python
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistri... | en | 0.730769 | #!/usr/bin/python # Software License Agreement (BSD License) # # Copyright (c) 2009-2011, Eucalyptus Systems, Inc. # All rights reserved. # # Redistribution and use of this software in source and binary forms, with or # without modification, are permitted provided that the following conditions # are met: # # Redistri... | 1.595747 | 2 |
intValues.py | jules552/ProjetISN | 0 | 6301 | MAP = 1
SPEED = 1.5
VELOCITYRESET = 6
WIDTH = 1280
HEIGHT = 720
X = WIDTH / 2 - 50
Y = HEIGHT / 2 - 50
MOUSER = 325
TICKRATES = 120
nfc = False
raspberry = False | MAP = 1
SPEED = 1.5
VELOCITYRESET = 6
WIDTH = 1280
HEIGHT = 720
X = WIDTH / 2 - 50
Y = HEIGHT / 2 - 50
MOUSER = 325
TICKRATES = 120
nfc = False
raspberry = False | none | 1 | 1.195565 | 1 | |
April/Apr_25_2019/builder.py | while1618/DailyCodingProblem | 1 | 6302 | <reponame>while1618/DailyCodingProblem
# This problem was asked by Facebook.
#
# A builder is looking to build a row of N houses that can be of K different colors.
# He has a goal of minimizing cost while ensuring that no two neighboring houses are of the same color.
#
# Given an N by K matrix where the nth row and kth... | # This problem was asked by Facebook.
#
# A builder is looking to build a row of N houses that can be of K different colors.
# He has a goal of minimizing cost while ensuring that no two neighboring houses are of the same color.
#
# Given an N by K matrix where the nth row and kth column represents the cost to build th... | en | 0.973544 | # This problem was asked by Facebook. # # A builder is looking to build a row of N houses that can be of K different colors. # He has a goal of minimizing cost while ensuring that no two neighboring houses are of the same color. # # Given an N by K matrix where the nth row and kth column represents the cost to build th... | 3.00817 | 3 |
experiments/delaney/plot.py | pfnet-research/bayesgrad | 57 | 6303 | import argparse
import numpy as np
import os
import sys
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from saliency.visualizer.smiles_visualizer import SmilesVisualizer
def visualize(dir_path):
... | import argparse
import numpy as np
import os
import sys
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from saliency.visualizer.smiles_visualizer import SmilesVisualizer
def visualize(dir_path):
... | en | 0.136242 | # Red for positive value # Blue for negative value # legend = "t:{}, p:{}".format(ans, out) # '.svg' # visualizer.visualize( # saliency_vanilla[id], smiles, save_filepath=os.path.join(parent_dir, "result_vanilla", str(id) + ext), # visualize_ratio=1.0, legend=legend, scaler=scaler_vanilla, color_fn=color) # vis... | 2.306596 | 2 |
public/js/tinymice/plugins/bootstrap/jquery-file-tree/connectors/jqueryFileTree.py | btybug/main.albumbugs | 13 | 6304 | #
# jQuery File Tree
# Python/Django connector script
# By <NAME>
#
import os
import urllib
def dirlist(request):
r=['<ul class="jqueryFileTree" style="display: none;">']
try:
r=['<ul class="jqueryFileTree" style="display: none;">']
d=urllib.unquote(request.POST.get('dir','c:\\temp'))
for f ... | #
# jQuery File Tree
# Python/Django connector script
# By <NAME>
#
import os
import urllib
def dirlist(request):
r=['<ul class="jqueryFileTree" style="display: none;">']
try:
r=['<ul class="jqueryFileTree" style="display: none;">']
d=urllib.unquote(request.POST.get('dir','c:\\temp'))
for f ... | en | 0.528374 | # # jQuery File Tree # Python/Django connector script # By <NAME> # # get .ext and remove dot | 2.138865 | 2 |
gpytorch/lazy/chol_lazy_tensor.py | harvineet/gpytorch | 0 | 6305 | <filename>gpytorch/lazy/chol_lazy_tensor.py
#!/usr/bin/env python3
import torch
from .lazy_tensor import LazyTensor
from .root_lazy_tensor import RootLazyTensor
from .. import settings
class CholLazyTensor(RootLazyTensor):
def __init__(self, chol):
if isinstance(chol, LazyTensor): # Probably is an inst... | <filename>gpytorch/lazy/chol_lazy_tensor.py
#!/usr/bin/env python3
import torch
from .lazy_tensor import LazyTensor
from .root_lazy_tensor import RootLazyTensor
from .. import settings
class CholLazyTensor(RootLazyTensor):
def __init__(self, chol):
if isinstance(chol, LazyTensor): # Probably is an inst... | en | 0.743061 | #!/usr/bin/env python3 # Probably is an instance of NonLazyTensor # Check that we have a lower triangular matrix # Run super constructor | 2.061807 | 2 |
pirates/audio/AmbientManagerBase.py | ksmit799/POTCO-PS | 8 | 6306 | <filename>pirates/audio/AmbientManagerBase.py
# File: A (Python 2.4)
from pandac.PandaModules import AudioSound
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import LerpFunc, Sequence
from direct.showbase.DirectObject import DirectObject
class AmbientSound:
notify = Direct... | <filename>pirates/audio/AmbientManagerBase.py
# File: A (Python 2.4)
from pandac.PandaModules import AudioSound
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import LerpFunc, Sequence
from direct.showbase.DirectObject import DirectObject
class AmbientSound:
notify = Direct... | en | 0.682188 | # File: A (Python 2.4) | 2.317198 | 2 |
test/tests/import_test.py | jmgc/pyston | 1 | 6307 | <gh_stars>1-10
import import_target
print import_target.x
import import_target
import_target.foo()
c = import_target.C()
print import_target.import_nested_target.y
import_target.import_nested_target.bar()
d = import_target.import_nested_target.D()
print "testing importfrom:"
from import_target import x as z
print z... | import import_target
print import_target.x
import import_target
import_target.foo()
c = import_target.C()
print import_target.import_nested_target.y
import_target.import_nested_target.bar()
d = import_target.import_nested_target.D()
print "testing importfrom:"
from import_target import x as z
print z
import_nested... | none | 1 | 2.363302 | 2 | |
hexrd/ui/matrix_editor.py | HEXRD/hexrdgui | 13 | 6308 | import numpy as np
from PySide2.QtCore import QSignalBlocker, Signal
from PySide2.QtWidgets import QGridLayout, QWidget
from hexrd.ui.scientificspinbox import ScientificDoubleSpinBox
DEFAULT_ENABLED_STYLE_SHEET = 'background-color: white'
DEFAULT_DISABLED_STYLE_SHEET = 'background-color: #F0F0F0'
INVALID_MATRIX_STY... | import numpy as np
from PySide2.QtCore import QSignalBlocker, Signal
from PySide2.QtWidgets import QGridLayout, QWidget
from hexrd.ui.scientificspinbox import ScientificDoubleSpinBox
DEFAULT_ENABLED_STYLE_SHEET = 'background-color: white'
DEFAULT_DISABLED_STYLE_SHEET = 'background-color: #F0F0F0'
INVALID_MATRIX_STY... | en | 0.764652 | #F0F0F0' # If this is not None, then only the elements present in the # list (as (i, j) items) will be enabled. # If this is set, it will be called every time the data updates # to apply equality constraints. # Whether or not the matrix is currently invalid # Reason the matrix is currently invalid # noqa: F841 # Resets... | 2.326754 | 2 |
data/train/python/990aa6cbf16ed34f5030609c03ab43c0f0ed8c2aurls.py | harshp8l/deep-learning-lang-detection | 84 | 6309 | from django.conf.urls.defaults import *
urlpatterns = patterns('pytorque.views',
(r'^$', 'central_dispatch_view'),
(r'^browse$', 'central_dispatch_view'),
(r'^monitor$', 'central_dispatch_view'),
(r'^submit$', 'central_dispatch_view'),
(r'^stat$', 'central_dispatch_view'),
(r'^login/$', 'login... | from django.conf.urls.defaults import *
urlpatterns = patterns('pytorque.views',
(r'^$', 'central_dispatch_view'),
(r'^browse$', 'central_dispatch_view'),
(r'^monitor$', 'central_dispatch_view'),
(r'^submit$', 'central_dispatch_view'),
(r'^stat$', 'central_dispatch_view'),
(r'^login/$', 'login... | en | 0.280912 | # (r'^$', 'central_dispatch_view'), # (r'^user/(?P<username>\w{0,50})/monitor', 'monitor'), # (r'^user/(?P<username>\w{0,50})/submit', 'submit'), # (r'^user/(?P<username>\w{0,50})/stat', 'stat'), | 1.729648 | 2 |
checkerpy/types/all/typedtuple.py | yedivanseven/CheckerPy | 1 | 6310 | from typing import Tuple, Union, Any, Sequence
from collections import deque, defaultdict, OrderedDict
from ...validators.one import JustLen
from ...functional.mixins import CompositionClassMixin
from ..one import Just
dict_keys = type({}.keys())
odict_keys = type(OrderedDict({}).keys())
dict_values = type({}.values()... | from typing import Tuple, Union, Any, Sequence
from collections import deque, defaultdict, OrderedDict
from ...validators.one import JustLen
from ...functional.mixins import CompositionClassMixin
from ..one import Just
dict_keys = type({}.keys())
odict_keys = type(OrderedDict({}).keys())
dict_values = type({}.values()... | en | 0.757027 | Checks for different type(s) of each element in a defined-length tuple. Parameters ---------- value : tuple The tuple to check the length and element types of. name : str, optional The name of the tuple to check the length and the element type(s) of. Defaults to None. types ... | 2.840825 | 3 |
data/analyzer/linux/lib/common/abstracts.py | iswenhao/Panda-Sandbox | 2 | 6311 | <gh_stars>1-10
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.api.process import Process
from lib.exceptions.exceptions import CuckooPackageError
class Package(object):
"""Base abstrac... | # Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.api.process import Process
from lib.exceptions.exceptions import CuckooPackageError
class Package(object):
"""Base abstract analysis pack... | en | 0.758281 | # Copyright (C) 2014-2016 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. Base abstract analysis package. @param options: options dict. Update list of monitored PIDs in the package context. @param pids: list of pids. R... | 2.050851 | 2 |
rdmo/options/apps.py | Raspeanut/rdmo | 1 | 6312 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class OptionsConfig(AppConfig):
name = 'rdmo.options'
verbose_name = _('Options')
| from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class OptionsConfig(AppConfig):
name = 'rdmo.options'
verbose_name = _('Options')
| none | 1 | 1.377516 | 1 | |
main/admin.py | sirodoht/mal | 2 | 6313 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from main import models
class Admin(UserAdmin):
list_display = ("id", "username", "email", "date_joined", "last_login")
admin.site.register(models.User, Admin)
class DocumentAdmin(admin.ModelAdmin):
list_display = ("id", "ti... | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from main import models
class Admin(UserAdmin):
list_display = ("id", "username", "email", "date_joined", "last_login")
admin.site.register(models.User, Admin)
class DocumentAdmin(admin.ModelAdmin):
list_display = ("id", "ti... | none | 1 | 2.080429 | 2 | |
cloudshell/cli/configurator.py | QualiSystems/cloudshell-cli | 4 | 6314 | <gh_stars>1-10
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from cloudshell.cli.factory.session_factory import (
CloudInfoAccessKeySessionFactory,
GenericSessionFactory,
SessionFactory,
)
from cloudshell.cli.service.cli imp... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from cloudshell.cli.factory.session_factory import (
CloudInfoAccessKeySessionFactory,
GenericSessionFactory,
SessionFactory,
)
from cloudshell.cli.service.cli import CLI
from cl... | en | 0.490575 | #!/usr/bin/python # -*- coding: utf-8 -*- Using factories instead of Initialize CLI service configurator. :param cloudshell.shell.standards.resource_config_generic_models.GenericCLIConfig resource_config: # noqa: E501 :param logging.Logger logger: :param cloudshell.cli.service.cli.CLI cli: ... | 2.035434 | 2 |
examples/ingenerator.py | quynhanh-ngx/pytago | 206 | 6315 | def main():
n = 111
gen = (n * 7 for x in range(10))
if 777 in gen:
print("Yes!")
if __name__ == '__main__':
main()
| def main():
n = 111
gen = (n * 7 for x in range(10))
if 777 in gen:
print("Yes!")
if __name__ == '__main__':
main()
| none | 1 | 3.247231 | 3 | |
source/packages/scs-pm-server/src/python-server/app.py | amittkSharma/scs_predictive_maintenance | 0 | 6316 | import json
import logging
import joblib
import pandas as pd
from flask import Flask, jsonify, request
from flask_cors import CORS, cross_origin
app = Flask(__name__)
CORS(app)
@app.route("/api/machinePrediction", methods=['GET'])
def home():
incomingMachineId = request.args.get('machineId')
modelPath = requ... | import json
import logging
import joblib
import pandas as pd
from flask import Flask, jsonify, request
from flask_cors import CORS, cross_origin
app = Flask(__name__)
CORS(app)
@app.route("/api/machinePrediction", methods=['GET'])
def home():
incomingMachineId = request.args.get('machineId')
modelPath = requ... | en | 0.319447 | # To start the server # python3 app.py | 2.673555 | 3 |
tests/test_remove_from_dependee_chain.py | ess-dmsc/nexus-constructor | 3 | 6317 | import pytest
from PySide2.QtGui import QVector3D
from nexus_constructor.model.component import Component
from nexus_constructor.model.dataset import Dataset
from nexus_constructor.model.instrument import Instrument
from nexus_constructor.model.value_type import ValueTypes
values = Dataset(
name="scalar_value",
... | import pytest
from PySide2.QtGui import QVector3D
from nexus_constructor.model.component import Component
from nexus_constructor.model.dataset import Dataset
from nexus_constructor.model.instrument import Instrument
from nexus_constructor.model.value_type import ValueTypes
values = Dataset(
name="scalar_value",
... | none | 1 | 2.094067 | 2 | |
fastmvsnet/train1.py | molspace/FastMVS_experiments | 0 | 6318 | <filename>fastmvsnet/train1.py
#!/usr/bin/env python
import argparse
import os.path as osp
import logging
import time
import sys
sys.path.insert(0, osp.dirname(__file__) + '/..')
import torch
import torch.nn as nn
from fastmvsnet.config import load_cfg_from_file
from fastmvsnet.utils.io import mkdir
from fastmvsnet.u... | <filename>fastmvsnet/train1.py
#!/usr/bin/env python
import argparse
import os.path as osp
import logging
import time
import sys
sys.path.insert(0, osp.dirname(__file__) + '/..')
import torch
import torch.nn as nn
from fastmvsnet.config import load_cfg_from_file
from fastmvsnet.utils.io import mkdir
from fastmvsnet.u... | en | 0.527216 | #!/usr/bin/env python #print("LOSS DICT", loss_dict['coarse_loss']) #print("LOSSES", loss_dict.values()) # print(poop) # build model # build optimizer # build lr scheduler # build checkpointer # build data loader # build tensorboard logger (optionally by comment) # train # checkpoint # validate # best validation | 1.988347 | 2 |
modulo2/3-detectores/3.2-detector/models.py | fossabot/unifacisa-visao-computacional | 0 | 6319 | <reponame>fossabot/unifacisa-visao-computacional
# Estrutura básica para projetos de Machine Learning e Deep Learning
# Por <NAME>.
from torch import nn, relu
import torch.nn.functional as F
import torch.optim as optim
import torch
from torchvision import models
class ResNet(nn.Module):
def __init__(self, saida,... | # Estrutura básica para projetos de Machine Learning e Deep Learning
# Por <NAME>.
from torch import nn, relu
import torch.nn.functional as F
import torch.optim as optim
import torch
from torchvision import models
class ResNet(nn.Module):
def __init__(self, saida, pretreinado=True):
super(ResNet, self)._... | pt | 0.639243 | # Estrutura básica para projetos de Machine Learning e Deep Learning # Por <NAME>. | 3.619089 | 4 |
python/setup.py | sbrodeur/evert | 28 | 6320 | <filename>python/setup.py
#!/usr/bin/env python
# Copyright (c) 2017, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyrig... | <filename>python/setup.py
#!/usr/bin/env python
# Copyright (c) 2017, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyrig... | en | 0.702897 | #!/usr/bin/env python # Copyright (c) 2017, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of c... | 1.034543 | 1 |
somegame/fps_osd.py | kodo-pp/somegame-but-not-that-one | 0 | 6321 | import pygame
from loguru import logger
from somegame.osd import OSD
class FpsOSD(OSD):
def __init__(self, game):
super().__init__(game)
logger.info('Loading font')
self.font = pygame.font.Font(pygame.font.get_default_font(), 32)
def draw(self, surface):
fps = self.game.get_a... | import pygame
from loguru import logger
from somegame.osd import OSD
class FpsOSD(OSD):
def __init__(self, game):
super().__init__(game)
logger.info('Loading font')
self.font = pygame.font.Font(pygame.font.get_default_font(), 32)
def draw(self, surface):
fps = self.game.get_a... | none | 1 | 2.660189 | 3 | |
python/chronos/test/bigdl/chronos/data/experimental/test_xshardstsdataset.py | sgwhat/BigDL | 0 | 6322 | <reponame>sgwhat/BigDL
#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | #
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | en | 0.843222 | # # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ... | 2.159255 | 2 |
zoom_functions.py | WXSD-Sales/ZoomToWebex | 1 | 6323 | import json
import tornado.gen
import traceback
from base64 import b64encode
from tornado.httpclient import AsyncHTTPClient, HTTPRequest, HTTPError
from settings import Settings
from mongo_db_controller import ZoomUserDB
@tornado.gen.coroutine
def zoomRefresh(zoom_user):
url = "https://zoom.us/oauth/token"
p... | import json
import tornado.gen
import traceback
from base64 import b64encode
from tornado.httpclient import AsyncHTTPClient, HTTPRequest, HTTPError
from settings import Settings
from mongo_db_controller import ZoomUserDB
@tornado.gen.coroutine
def zoomRefresh(zoom_user):
url = "https://zoom.us/oauth/token"
p... | en | 0.838452 | #we need to base 64 encode it #and then decode it to acsii as python 3 stores it as a byte string | 2.35067 | 2 |
crypten/mpc/__init__.py | gmuraru/CrypTen | 0 | 6324 | <gh_stars>0
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from crypten.mpc import primitives # noqa: F401
from crypten.mpc import provider # noqa: F40
... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from crypten.mpc import primitives # noqa: F401
from crypten.mpc import provider # noqa: F40
from .conte... | en | 0.832175 | #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # noqa: F401 # noqa: F40 # the different private type attributes of an mpc encrypted tensor # Set provider | 2.003813 | 2 |
contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/pyflakes.py | lahosken/pants | 0 | 6325 | <reponame>lahosken/pants<filename>contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/pyflakes.py<gh_stars>0
# 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, divi... | # 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 pyflakes.checke... | en | 0.807509 | # coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). # TODO(wickman) There is overlap between this and Flake8 -- consider integrating # checkstyle plug-ins into the PEP8 tool directly so that this can be inherited # by flake8. ... | 2.029884 | 2 |
pharmrep/forum/models.py | boyombo/pharmrep | 0 | 6326 | <gh_stars>0
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
class Forum(models.Model):
title = models.CharField(max_length=60)
description = models.TextField(blank=True, default='')
updated = m... | from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
class Forum(models.Model):
title = models.CharField(max_length=60)
description = models.TextField(blank=True, default='')
updated = models.DateTi... | none | 1 | 2.229975 | 2 | |
iri-node/fabfile.py | jinnerbichler/home-automflashion | 8 | 6327 | <gh_stars>1-10
import time
from fabric.api import run, env, task, put, cd, local, sudo
env.use_ssh_config = True
env.hosts = ['iota_node']
@task(default=True)
def iri():
run('mkdir -p /srv/private-tangle/')
with cd('/srv/private-tangle'):
put('.', '.')
run('docker-compose --project-name priva... | import time
from fabric.api import run, env, task, put, cd, local, sudo
env.use_ssh_config = True
env.hosts = ['iota_node']
@task(default=True)
def iri():
run('mkdir -p /srv/private-tangle/')
with cd('/srv/private-tangle'):
put('.', '.')
run('docker-compose --project-name private-tangle pull'... | en | 0.972916 | # stop services and delete database # restart all services | 1.880043 | 2 |
features.py | ptorresmanque/MachineLearning_v2.0 | 0 | 6328 | import sqlite3
from random import randint, choice
import numpy as np
conn = sqlite3.connect('ej.db')
c = conn.cursor()
#OBTENIENDO TAMAnOS MAXIMOS MINIMOS Y PROMEDIO#
c.execute('SELECT MAX(alto) FROM features')
resultado = c.fetchone()
if resultado:
altoMax = resultado[0]
c.execute('SELECT MIN(alto) FROM featu... | import sqlite3
from random import randint, choice
import numpy as np
conn = sqlite3.connect('ej.db')
c = conn.cursor()
#OBTENIENDO TAMAnOS MAXIMOS MINIMOS Y PROMEDIO#
c.execute('SELECT MAX(alto) FROM features')
resultado = c.fetchone()
if resultado:
altoMax = resultado[0]
c.execute('SELECT MIN(alto) FROM featu... | en | 0.132159 | #OBTENIENDO TAMAnOS MAXIMOS MINIMOS Y PROMEDIO# #print altoMax , altoProm , altoMin #### CREANDO CLASES NEGATIVAS | 2.996721 | 3 |
dev/ideas/cython/playing_around.py | achilleas-k/brian2 | 0 | 6329 | <filename>dev/ideas/cython/playing_around.py
from pylab import *
import cython
import time, timeit
from brian2.codegen.runtime.cython_rt.modified_inline import modified_cython_inline
import numpy
from scipy import weave
import numexpr
import theano
from theano import tensor as tt
tau = 20 * 0.001
N = 100000... | <filename>dev/ideas/cython/playing_around.py
from pylab import *
import cython
import time, timeit
from brian2.codegen.runtime.cython_rt.modified_inline import modified_cython_inline
import numpy
from scipy import weave
import numexpr
import theano
from theano import tensor as tt
tau = 20 * 0.001
N = 100000... | en | 0.205753 | # constant current mean, the modulation varies # 'sin': numpy.sin, cdef int _idx
cdef int _vectorisation_idx
cdef int N = <int>_N
cdef double a, v, _v
#cdef double [:] _cy_array_neurongroup_a = _array_neurongroup_a
#cdef double [:] _cy_array_neurongroup_v = _array_neurongroup_v
cdef double* _cy_array_neurongroup_... | 1.938592 | 2 |
azbankgateways/views/__init__.py | lordmahyar/az-iranian-bank-gateways | 196 | 6330 | <reponame>lordmahyar/az-iranian-bank-gateways<gh_stars>100-1000
from .banks import callback_view, go_to_bank_gateway
from .samples import sample_payment_view, sample_result_view
| from .banks import callback_view, go_to_bank_gateway
from .samples import sample_payment_view, sample_result_view | none | 1 | 1.033667 | 1 | |
dev/unittest/update.py | PowerDNS/exabgp | 8 | 6331 | #!/usr/bin/env python
# encoding: utf-8
"""
update.py
Created by <NAME> on 2009-09-06.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
import unittest
from exabgp.configuration.environment import environment
env = environment.setup('')
from exabgp.bgp.message.update.update import *
from exabgp.bgp.me... | #!/usr/bin/env python
# encoding: utf-8
"""
update.py
Created by <NAME> on 2009-09-06.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
import unittest
from exabgp.configuration.environment import environment
env = environment.setup('')
from exabgp.bgp.message.update.update import *
from exabgp.bgp.me... | en | 0.429651 | #!/usr/bin/env python # encoding: utf-8 update.py Created by <NAME> on 2009-09-06. Copyright (c) 2009-2013 Exa Networks. All rights reserved. # def test_2_ipv4_broken (self): # header = ''.join([chr(c) for c in h]) # message = ''.join([chr(c) for c in m]) # message = ''.join([chr(c) for c in [0x0, 0x0, 0x0, 0xf, 0x... | 2.312634 | 2 |
nuscenes/eval/detection/evaluate.py | WJ-Lai/NightFusion | 0 | 6332 | # nuScenes dev-kit.
# Code written by <NAME> & <NAME>, 2018.
# Licensed under the Creative Commons [see licence.txt]
import argparse
import json
import os
import random
import time
from typing import Tuple, Dict, Any
import numpy as np
from nuscenes import NuScenes
from nuscenes.eval.detection.algo import accumulate... | # nuScenes dev-kit.
# Code written by <NAME> & <NAME>, 2018.
# Licensed under the Creative Commons [see licence.txt]
import argparse
import json
import os
import random
import time
from typing import Tuple, Dict, Any
import numpy as np
from nuscenes import NuScenes
from nuscenes.eval.detection.algo import accumulate... | en | 0.712255 | # nuScenes dev-kit. # Code written by <NAME> & <NAME>, 2018. # Licensed under the Creative Commons [see licence.txt] This is the official nuScenes detection evaluation code. Results are written to the provided output_dir. nuScenes uses the following metrics: - Mean Average Precision (mAP): Uses center-dist... | 2.1697 | 2 |
tests/get_problem_atcoder.py | aberent/api-client | 0 | 6333 | <reponame>aberent/api-client
import unittest
from onlinejudge_api.main import main
class DownloadAtCoderTest(unittest.TestCase):
def test_icpc2013spring_a(self):
"""This problem contains both words `Input` and `Output` for the headings for sample outputs.
"""
url = 'http://jag2013spring.... | import unittest
from onlinejudge_api.main import main
class DownloadAtCoderTest(unittest.TestCase):
def test_icpc2013spring_a(self):
"""This problem contains both words `Input` and `Output` for the headings for sample outputs.
"""
url = 'http://jag2013spring.contest.atcoder.jp/tasks/icpc... | en | 0.799499 | This problem contains both words `Input` and `Output` for the headings for sample outputs. This problem uses <code> tags in the descriptoin text in the sample section. This tests a problem which uses a new-style format HTML. This tests a problem which uses an old-style format HTML. In this problem, a sample output is e... | 3.215197 | 3 |
odm/libexec/odm_tenant.py | UMCollab/ODM | 2 | 6334 | <reponame>UMCollab/ODM
#!/usr/bin/env python3
# This file is part of ODM and distributed under the terms of the
# MIT license. See COPYING.
import json
import sys
import odm.cli
def main():
cli = odm.cli.CLI(['action'])
client = cli.client
if cli.args.action == 'list-users':
print(json.dumps(c... | #!/usr/bin/env python3
# This file is part of ODM and distributed under the terms of the
# MIT license. See COPYING.
import json
import sys
import odm.cli
def main():
cli = odm.cli.CLI(['action'])
client = cli.client
if cli.args.action == 'list-users':
print(json.dumps(client.list_users(), ind... | en | 0.792455 | #!/usr/bin/env python3 # This file is part of ODM and distributed under the terms of the # MIT license. See COPYING. | 2.215681 | 2 |
tests/test_tag_value_parser.py | quaresmajose/tools-python | 74 | 6335 | # Copyright (c) 2014 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softwar... | # Copyright (c) 2014 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softwar... | en | 0.604532 | # Copyright (c) 2014 <NAME> # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, softwar... | 2.114914 | 2 |
mount_drives.py | DT-was-an-ET/fanshim-python-pwm | 0 | 6336 | # Standard library imports
from subprocess import call as subprocess_call
from utility import fileexists
from time import sleep as time_sleep
from datetime import datetime
mount_try = 1
not_yet = True
done = False
start_time = datetime.now()
if fileexists("/home/rpi4-sftp/usb/drive_present.txt"):
when_usba... | # Standard library imports
from subprocess import call as subprocess_call
from utility import fileexists
from time import sleep as time_sleep
from datetime import datetime
mount_try = 1
not_yet = True
done = False
start_time = datetime.now()
if fileexists("/home/rpi4-sftp/usb/drive_present.txt"):
when_usba... | en | 0.559237 | # Standard library imports | 2.5951 | 3 |
home/views.py | Kshitij-Kumar-Singh-Chauhan/docon | 0 | 6337 | from django.http.response import HttpResponse
from django.shortcuts import render
from django.shortcuts import redirect, render
from cryptography.fernet import Fernet
from .models import Book, UserDetails
from .models import Contact
from .models import Book
from .models import Report
from .models import Diagnostic
from... | from django.http.response import HttpResponse
from django.shortcuts import render
from django.shortcuts import redirect, render
from cryptography.fernet import Fernet
from .models import Book, UserDetails
from .models import Contact
from .models import Book
from .models import Report
from .models import Diagnostic
from... | en | 0.700204 | # Create your views here. # name=(object.name) # appointment(request,email,name) # def index(request): # context={ 'alpha': 'This is sent'} # if request.method=='POST': # pass # else: return render(request, 'index.html',context) #HttpResponse('This is homepage') # messages.success(request, 'Your mes... | 2.195432 | 2 |
hkube_python_wrapper/storage/base_storage_manager.py | kube-HPC/python-wrapper.hkube | 1 | 6338 |
class BaseStorageManager(object):
def __init__(self, adpter):
self.adapter = adpter
def put(self, options):
try:
return self.adapter.put(options)
except Exception:
raise Exception('Failed to write data to storage')
def get(self, options):
try:
... |
class BaseStorageManager(object):
def __init__(self, adpter):
self.adapter = adpter
def put(self, options):
try:
return self.adapter.put(options)
except Exception:
raise Exception('Failed to write data to storage')
def get(self, options):
try:
... | none | 1 | 3.049694 | 3 | |
compressor/tests/templatetags.py | bigmlcom/django_compressor | 0 | 6339 | <reponame>bigmlcom/django_compressor
from __future__ import with_statement
import os
import sys
from mock import Mock
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase
from compressor.conf import settings
from compressor.signals import post_compress
from compressor.... | from __future__ import with_statement
import os
import sys
from mock import Mock
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase
from compressor.conf import settings
from compressor.signals import post_compress
from compressor.tests.base import css_tag, test_dir
... | en | 0.226065 | A shortcut for testing template output. {% load compress %}{% compress js %}{% block js %} {% endblock %}{% endcompress %} {% load compress %}{% compress css %} <link rel="stylesheet" href="{{ MEDIA_URL }}css/one.css" type="text/css"> <style type="text/css">p { border:5px solid green;}</style> <link rel="styles... | 2.19613 | 2 |
cle/cle/backends/relocations/generic.py | Ruide/angr-dev | 0 | 6340 | <reponame>Ruide/angr-dev
from ...address_translator import AT
from ...errors import CLEOperationError
from . import Relocation
import struct
import logging
l = logging.getLogger('cle.relocations.generic')
class GenericAbsoluteReloc(Relocation):
@property
def value(self):
return self.resolvedby.rebased... | from ...address_translator import AT
from ...errors import CLEOperationError
from . import Relocation
import struct
import logging
l = logging.getLogger('cle.relocations.generic')
class GenericAbsoluteReloc(Relocation):
@property
def value(self):
return self.resolvedby.rebased_addr
class GenericAbsol... | en | 0.837832 | # pylint: disable=unused-argument # don't touch local relocations on the main bin A mix-in class for relocations that cover a 32-bit field regardless of the architecture's address word length. # If True, 32-bit truncated value must equal to its original when zero-extended # If True, 32-bit truncated value must equal to... | 1.946811 | 2 |
codes/Lib/site-packages/openpyxl/writer/tests/test_style.py | charlescayno/automation | 0 | 6341 | # Copyright (c) 2010-2014 openpyxl
import pytest
from openpyxl.styles.borders import Border, Side
from openpyxl.styles.fills import GradientFill
from openpyxl.styles.colors import Color
from openpyxl.writer.styles import StyleWriter
from openpyxl.tests.helper import get_xml, compare_xml
class DummyWorkbook:
st... | # Copyright (c) 2010-2014 openpyxl
import pytest
from openpyxl.styles.borders import Border, Side
from openpyxl.styles.fills import GradientFill
from openpyxl.styles.colors import Color
from openpyxl.writer.styles import StyleWriter
from openpyxl.tests.helper import get_xml, compare_xml
class DummyWorkbook:
st... | en | 0.273973 | # Copyright (c) 2010-2014 openpyxl <?xml version="1.0" ?> <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <gradientFill degree="90" type="linear"> <stop position="0"> <color theme="0"/> </stop> <stop position="1"> <color theme="4"/> </stop> </gradientFill> ... | 2.421049 | 2 |
ringapp/migrations/0009_auto_20150116_1759.py | rschwiebert/RingApp | 10 | 6342 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ringapp', '0008_auto_20150116_1755'),
]
operations = [
migrations.AlterModelTable(
name='invarian... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ringapp', '0008_auto_20150116_1755'),
]
operations = [
migrations.AlterModelTable(
name='invariance',
... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.379405 | 1 |
front-end/testsuite-python-lib/Python-3.1/Lib/json/tests/test_dump.py | MalloyPower/parsing-python | 1 | 6343 | from unittest import TestCase
from io import StringIO
import json
class TestDump(TestCase):
def test_dump(self):
sio = StringIO()
json.dump({}, sio)
self.assertEquals(sio.getvalue(), '{}')
def test_dumps(self):
self.assertEquals(json.dumps({}), '{}')
def test_encode_truef... | from unittest import TestCase
from io import StringIO
import json
class TestDump(TestCase):
def test_dump(self):
sio = StringIO()
json.dump({}, sio)
self.assertEquals(sio.getvalue(), '{}')
def test_dumps(self):
self.assertEquals(json.dumps({}), '{}')
def test_encode_truef... | none | 1 | 3.025893 | 3 | |
src/resources/clients/python_client/visitstate.py | visit-dav/vis | 226 | 6344 | <reponame>visit-dav/vis
import sys
class RPCType(object):
CloseRPC = 0
DetachRPC = 1
AddWindowRPC = 2
DeleteWindowRPC = 3
SetWindowLayoutRPC = 4
SetActiveWindowRPC = 5
ClearWindowRPC = 6
ClearAllWindowsRPC = 7
OpenDatabaseRPC = 8
CloseData... | import sys
class RPCType(object):
CloseRPC = 0
DetachRPC = 1
AddWindowRPC = 2
DeleteWindowRPC = 3
SetWindowLayoutRPC = 4
SetActiveWindowRPC = 5
ClearWindowRPC = 6
ClearAllWindowsRPC = 7
OpenDatabaseRPC = 8
CloseDatabaseRPC = 9
Acti... | none | 1 | 1.673345 | 2 | |
tests/__init__.py | zhangyiming07/QT4C | 53 | 6345 | # -*- coding: utf-8 -*-
#
# Tencent is pleased to support the open source community by making QT4C available.
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
# QT4C is licensed under the BSD 3-Clause License, except for the third-party components listed below.
# A copy of the BSD 3-Cla... | # -*- coding: utf-8 -*-
#
# Tencent is pleased to support the open source community by making QT4C available.
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
# QT4C is licensed under the BSD 3-Clause License, except for the third-party components listed below.
# A copy of the BSD 3-Cla... | en | 0.909727 | # -*- coding: utf-8 -*- # # Tencent is pleased to support the open source community by making QT4C available. # Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. # QT4C is licensed under the BSD 3-Clause License, except for the third-party components listed below. # A copy of the BSD 3-Clause... | 1.681595 | 2 |
brute/brute_build.py | sweetsbeats/starter-snake-python | 0 | 6346 | from cffi import FFI
ffibuilder = FFI()
ffibuilder.cdef("""
int test(int t);
""")
ffibuilder.set_source("_pi_cffi",
"""
#include "brute.h"
""",
sources=['brute.c'])
if __name__ == "__main__":
ffibuilder.compile(verbose = Tru... | from cffi import FFI
ffibuilder = FFI()
ffibuilder.cdef("""
int test(int t);
""")
ffibuilder.set_source("_pi_cffi",
"""
#include "brute.h"
""",
sources=['brute.c'])
if __name__ == "__main__":
ffibuilder.compile(verbose = Tru... | uk | 0.106864 | int test(int t); #include "brute.h" | 1.234411 | 1 |
src/board.py | JNotelddim/python-snake | 0 | 6347 | """Board Module"""
import copy
from typing import Tuple, List
from src.coordinate import Coordinate
from src.snake import Snake
class Board:
"""Track the cooardinates for all snakes and food in the game."""
def __init__(self, data):
self._data = data
self._snakes = None
self._foods = No... | """Board Module"""
import copy
from typing import Tuple, List
from src.coordinate import Coordinate
from src.snake import Snake
class Board:
"""Track the cooardinates for all snakes and food in the game."""
def __init__(self, data):
self._data = data
self._snakes = None
self._foods = No... | en | 0.910115 | Board Module Track the cooardinates for all snakes and food in the game. Retreive the list of snakes from the board data. Retreive the list of food from the board data. Get width of the board -- note: it's a square. Check whether or not the Coordinate is within the bounds of the Board. Get the List of Snakes whose IDs ... | 3.854335 | 4 |
personalized_nlp/datasets/wiki/base.py | CLARIN-PL/personalized-nlp | 0 | 6348 | <reponame>CLARIN-PL/personalized-nlp
import os
import zipfile
from typing import List
import pandas as pd
import urllib
from personalized_nlp.settings import STORAGE_DIR
from personalized_nlp.utils.data_splitting import split_texts
from personalized_nlp.datasets.datamodule_base import BaseDataModule
class WikiDataM... | import os
import zipfile
from typing import List
import pandas as pd
import urllib
from personalized_nlp.settings import STORAGE_DIR
from personalized_nlp.utils.data_splitting import split_texts
from personalized_nlp.datasets.datamodule_base import BaseDataModule
class WikiDataModule(BaseDataModule):
def __init... | none | 1 | 2.695222 | 3 | |
App/migrations/0010_remove_user_percentage_preferences_user_preferences.py | dlanghorne0428/StudioMusicPlayer | 0 | 6349 | <filename>App/migrations/0010_remove_user_percentage_preferences_user_preferences.py
# Generated by Django 4.0 on 2022-03-03 02:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('App', '0009_alter_song_holiday_alter_songfileinput_holiday'),
]
o... | <filename>App/migrations/0010_remove_user_percentage_preferences_user_preferences.py
# Generated by Django 4.0 on 2022-03-03 02:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('App', '0009_alter_song_holiday_alter_songfileinput_holiday'),
]
o... | en | 0.840696 | # Generated by Django 4.0 on 2022-03-03 02:15 | 1.369389 | 1 |
venv/Lib/site-packages/captcha/conf/settings.py | Rudeus3Greyrat/admin-management | 1 | 6350 | import os
import warnings
from django.conf import settings
CAPTCHA_FONT_PATH = getattr(settings, 'CAPTCHA_FONT_PATH', os.path.normpath(os.path.join(os.path.dirname(__file__), '..', 'fonts/Vera.ttf')))
CAPTCHA_FONT_SIZE = getattr(settings, 'CAPTCHA_FONT_SIZE', 22)
CAPTCHA_LETTER_ROTATION = getattr(settings, 'CAPTCHA_L... | import os
import warnings
from django.conf import settings
CAPTCHA_FONT_PATH = getattr(settings, 'CAPTCHA_FONT_PATH', os.path.normpath(os.path.join(os.path.dirname(__file__), '..', 'fonts/Vera.ttf')))
CAPTCHA_FONT_SIZE = getattr(settings, 'CAPTCHA_FONT_SIZE', 22)
CAPTCHA_LETTER_ROTATION = getattr(settings, 'CAPTCHA_L... | en | 0.401123 | _"',.;:- # Minutes # Chars # CAPTCHA_IMAGE_BEFORE_FIELD = getattr(settings, 'CAPTCHA_IMAGE_BEFORE_FIELD', True) # Failsafe | 1.900621 | 2 |
pilbox/test/app_test.py | joevandyk/pilbox | 0 | 6351 | <filename>pilbox/test/app_test.py<gh_stars>0
from __future__ import absolute_import, division, print_function, \
with_statement
import logging
import os.path
import time
import tornado.escape
import tornado.gen
import tornado.ioloop
from tornado.test.util import unittest
from tornado.testing import AsyncHTTPTestC... | <filename>pilbox/test/app_test.py<gh_stars>0
from __future__ import absolute_import, division, print_function, \
with_statement
import logging
import os.path
import time
import tornado.escape
import tornado.gen
import tornado.ioloop
from tornado.test.util import unittest
from tornado.testing import AsyncHTTPTestC... | none | 1 | 2.208522 | 2 | |
hackathon/darkmattertemperaturedistribution/example.py | Neelraj21/phython | 6 | 6352 | <filename>hackathon/darkmattertemperaturedistribution/example.py<gh_stars>1-10
#!/usr/bin/env python
from scipy import *
from pylab import *
#from pylab import imshow
#!
#! Some graphical explorations of the Julia sets with python and pyreport
#!#########################################################################
... | <filename>hackathon/darkmattertemperaturedistribution/example.py<gh_stars>1-10
#!/usr/bin/env python
from scipy import *
from pylab import *
#from pylab import imshow
#!
#! Some graphical explorations of the Julia sets with python and pyreport
#!#########################################################################
... | en | 0.449252 | #!/usr/bin/env python #from pylab import imshow #! #! Some graphical explorations of the Julia sets with python and pyreport #!######################################################################### #$ #$ We start by defining a function J: #$ \[ J_c : z \rightarrow z^2 + c \] #$ #! If we study the divergence of funct... | 2.668376 | 3 |
resources/migrations/0126_add_field_disallow_overlapping_reservations_per_user.py | codepointtku/respa | 1 | 6353 | # Generated by Django 2.2.21 on 2021-06-23 12:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('resources', '0125_add_timmi_payload_model'),
]
operations = [
migrations.AddField(
model_name=... | # Generated by Django 2.2.21 on 2021-06-23 12:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('resources', '0125_add_timmi_payload_model'),
]
operations = [
migrations.AddField(
model_name=... | en | 0.814878 | # Generated by Django 2.2.21 on 2021-06-23 12:43 | 1.507241 | 2 |
src/lora_multihop/module_config.py | marv1913/lora_multihop | 0 | 6354 | import logging
from lora_multihop import serial_connection, variables
def config_module(configuration=variables.MODULE_CONFIG):
if serial_connection.execute_command(configuration, [variables.STATUS_OK]):
serial_connection.execute_command('AT+SEND=1', [variables.STATUS_OK])
serial_connection.execu... | import logging
from lora_multihop import serial_connection, variables
def config_module(configuration=variables.MODULE_CONFIG):
if serial_connection.execute_command(configuration, [variables.STATUS_OK]):
serial_connection.execute_command('AT+SEND=1', [variables.STATUS_OK])
serial_connection.execu... | none | 1 | 2.348034 | 2 | |
eris/script/ferdian.py | ferdianap/Eris_test | 1 | 6355 | <reponame>ferdianap/Eris_test
#!/usr/bin/env python
# Copyright (c) 2013-2014, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain ... | #!/usr/bin/env python
# Copyright (c) 2013-2014, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# ... | en | 0.741896 | #!/usr/bin/env python # Copyright (c) 2013-2014, Rethink Robotics # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # ... | 1.693644 | 2 |
core/src/main/python/akdl/entry/base_entry.py | zhangjun0x01/Alink | 3,301 | 6356 | import abc
from typing import Dict, Callable
import tensorflow as tf
from flink_ml_framework.context import Context
from flink_ml_framework.java_file import *
from ..runner import tf_helper, io_helper
from ..runner.output_writer import DirectOutputWriter
try:
from flink_ml_tensorflow.tensorflow_context import TF... | import abc
from typing import Dict, Callable
import tensorflow as tf
from flink_ml_framework.context import Context
from flink_ml_framework.java_file import *
from ..runner import tf_helper, io_helper
from ..runner.output_writer import DirectOutputWriter
try:
from flink_ml_tensorflow.tensorflow_context import TF... | en | 0.679116 | # noinspection PyUnresolvedReferences Get function by the func name :param func_name: func name :return: function # load the module, will raise ImportError if module cannot be loaded # get the class, will raise AttributeError if class cannot be found # intra_op_parallelism is set by akdl, because there ... | 2.137483 | 2 |
corm-tests/test_corm_api.py | jbcurtin/cassandra-orm | 1 | 6357 | import pytest
ENCODING = 'utf-8'
@pytest.fixture(scope='function', autouse=True)
def setup_case(request):
def destroy_case():
from corm import annihilate_keyspace_tables, SESSIONS
annihilate_keyspace_tables('mykeyspace')
for keyspace_name, session in SESSIONS.copy().items():
if... | import pytest
ENCODING = 'utf-8'
@pytest.fixture(scope='function', autouse=True)
def setup_case(request):
def destroy_case():
from corm import annihilate_keyspace_tables, SESSIONS
annihilate_keyspace_tables('mykeyspace')
for keyspace_name, session in SESSIONS.copy().items():
if... | en | 0.542441 | # Keyspaces seem to have to start with Alpha-Letters # Order is not consistent # assert entry.random_number == values[idx]['random_number'] # assert entry.created == values[idx]['created'] # TODO: Build UserType integration # register_table(TestModelSelectSource) # register_table(TestModelSelectPivot) # Create Table or... | 2.191502 | 2 |
src/utilities/getInfo.py | UCSB-dataScience-ProjectGroup/movie_rating_prediction | 2 | 6358 | import json
import os
from utilities.SaveLoadJson import SaveLoadJson as SLJ
from utilities.LineCount import LineCount as LC
import subprocess
from geolite2 import geolite2
class getData:
#Get Data Functions ------------------------------------------------------
@staticmethod
def getDATA():
resu... | import json
import os
from utilities.SaveLoadJson import SaveLoadJson as SLJ
from utilities.LineCount import LineCount as LC
import subprocess
from geolite2 import geolite2
class getData:
#Get Data Functions ------------------------------------------------------
@staticmethod
def getDATA():
resu... | en | 0.330101 | #Get Data Functions ------------------------------------------------------ #Get Access Functions --------------------------------------------------- #f = open(newFile, 'w') #f.write(temp) #f.close() #Most recent stuff #Unique Users #Device percents #Country percents #os.system("sudo mv -f "+newFile+" "+logFile) | 2.609305 | 3 |
nemo/collections/nlp/losses/__init__.py | KalifiaBillal/NeMo | 1 | 6359 | from nemo.collections.nlp.losses.sgd_loss import SGDDialogueStateLoss
| from nemo.collections.nlp.losses.sgd_loss import SGDDialogueStateLoss
| none | 1 | 1.058699 | 1 | |
netrunner/test_settings.py | MrAGi/netrunner-cambridge | 0 | 6360 | # -*- coding: utf-8 -*-
from .settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['LOCAL_DB_NAME'],
'USER': os.environ['LOCAL_DB_USER'],
'PASSWORD': os.environ['LOCAL_DB_PASSWORD']... | # -*- coding: utf-8 -*-
from .settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['LOCAL_DB_NAME'],
'USER': os.environ['LOCAL_DB_USER'],
'PASSWORD': os.environ['LOCAL_DB_PASSWORD']... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.283888 | 1 |
Python_Exercicios/calcula_terreno.py | thalles-dreissig20/Quebra_Cabeca | 0 | 6361 | def area(larg, comp):
a = larg * comp
print(f'A dimensão é {a}')
print('Controle de terrenos')
print('-' * 20)
l = float(input('qual a largura do terreno: '))
c = float(input('qual o comprimento do terreno: '))
area(l , c) | def area(larg, comp):
a = larg * comp
print(f'A dimensão é {a}')
print('Controle de terrenos')
print('-' * 20)
l = float(input('qual a largura do terreno: '))
c = float(input('qual o comprimento do terreno: '))
area(l , c) | none | 1 | 3.707773 | 4 | |
Desafios/desafio_041.py | romulogoleniesky/Python_C_E_V | 0 | 6362 | <reponame>romulogoleniesky/Python_C_E_V
import datetime
ano = (datetime.datetime.now()).year
nasc = int(input("Digite o seu ano de nascimento: "))
categoria = 0
if (ano - nasc) <= 9:
categoria = str("MIRIM")
elif 9 < (ano - nasc) <= 14:
categoria = str("INFANTIL")
elif 14 < (ano - nasc) <= 19 :
categoria = ... | import datetime
ano = (datetime.datetime.now()).year
nasc = int(input("Digite o seu ano de nascimento: "))
categoria = 0
if (ano - nasc) <= 9:
categoria = str("MIRIM")
elif 9 < (ano - nasc) <= 14:
categoria = str("INFANTIL")
elif 14 < (ano - nasc) <= 19 :
categoria = str("JUNIOR")
elif 19 < (ano - nasc) <= ... | none | 1 | 4.054902 | 4 | |
eval/metrics.py | RecoHut-Stanzas/S168471 | 37 | 6363 | <filename>eval/metrics.py
import torch
def ndcg_binary_at_k_batch_torch(X_pred, heldout_batch, k=100, device='cpu'):
"""
Normalized Discounted Cumulative Gain@k for for predictions [B, I] and ground-truth [B, I], with binary relevance.
ASSUMPTIONS: all the 0's in heldout_batch indicate 0 relevance.
""... | <filename>eval/metrics.py
import torch
def ndcg_binary_at_k_batch_torch(X_pred, heldout_batch, k=100, device='cpu'):
"""
Normalized Discounted Cumulative Gain@k for for predictions [B, I] and ground-truth [B, I], with binary relevance.
ASSUMPTIONS: all the 0's in heldout_batch indicate 0 relevance.
""... | en | 0.825567 | Normalized Discounted Cumulative Gain@k for for predictions [B, I] and ground-truth [B, I], with binary relevance. ASSUMPTIONS: all the 0's in heldout_batch indicate 0 relevance. # batch_size # num. of non-zero items per batch. [B] Recall@k for predictions [B, I] and ground-truth [B, I]. # [B, K] # .toarray() # [B... | 2.383137 | 2 |
simba/run_dash_tkinter.py | justinshenk/simba | 172 | 6364 | # All credit to https://stackoverflow.com/questions/46571448/tkinter-and-a-html-file - thanks DELICA - https://stackoverflow.com/users/7027346/delica
from cefpython3 import cefpython as cef
import ctypes
try:
import tkinter as tk
from tkinter import messagebox
except ImportError:
import Tkinter as tk
impo... | # All credit to https://stackoverflow.com/questions/46571448/tkinter-and-a-html-file - thanks DELICA - https://stackoverflow.com/users/7027346/delica
from cefpython3 import cefpython as cef
import ctypes
try:
import tkinter as tk
from tkinter import messagebox
except ImportError:
import Tkinter as tk
impo... | en | 0.602515 | # All credit to https://stackoverflow.com/questions/46571448/tkinter-and-a-html-file - thanks DELICA - https://stackoverflow.com/users/7027346/delica # Fix for PyCharm hints warnings # Platforms # Globals # Root # MainFrame # Pack MainFrame #todo Fix CEF focus issues (#255). Call browser frame's focus_set to... | 2.766438 | 3 |
domain_data/mujoco_worlds/make_xml.py | sfpd/rlreloaded | 0 | 6365 | <gh_stars>0
import re
def do_substitution(in_lines):
lines_iter = iter(in_lines)
defn_lines = []
while True:
try:
line = lines_iter.next()
except StopIteration:
raise RuntimeError("didn't find line starting with ---")
if line.startswith('---'):
bre... | import re
def do_substitution(in_lines):
lines_iter = iter(in_lines)
defn_lines = []
while True:
try:
line = lines_iter.next()
except StopIteration:
raise RuntimeError("didn't find line starting with ---")
if line.startswith('---'):
break
e... | none | 1 | 2.989433 | 3 | |
myproject/apps/events/migrations/0002_alter_eventhero_options.py | cahyareza/django_admin_cookbook | 0 | 6366 | <reponame>cahyareza/django_admin_cookbook
# Generated by Django 3.2.12 on 2022-03-28 11:57
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='eventhero',
... | # Generated by Django 3.2.12 on 2022-03-28 11:57
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='eventhero',
options={'verbose_name_plural': ... | en | 0.844845 | # Generated by Django 3.2.12 on 2022-03-28 11:57 | 1.519964 | 2 |
hilton_sign_in.py | bmintz/python-snippets | 2 | 6367 | #!/usr/bin/env python3
# encoding: utf-8
import sys
import urllib.parse
import selenium.webdriver
def exit():
driver.quit()
sys.exit(0)
driver = selenium.webdriver.Firefox()
# for some reason, detectportal.firefox.com and connectivitycheck.gstatic.com are not blocked
# therefore, they cannot be used to detect con... | #!/usr/bin/env python3
# encoding: utf-8
import sys
import urllib.parse
import selenium.webdriver
def exit():
driver.quit()
sys.exit(0)
driver = selenium.webdriver.Firefox()
# for some reason, detectportal.firefox.com and connectivitycheck.gstatic.com are not blocked
# therefore, they cannot be used to detect con... | en | 0.902788 | #!/usr/bin/env python3 # encoding: utf-8 # for some reason, detectportal.firefox.com and connectivitycheck.gstatic.com are not blocked # therefore, they cannot be used to detect connectivity # we instead visit another site that is known not to ever have TLS | 2.688613 | 3 |
src/figures/trends/leaf_response.py | rhyswhitley/savanna_iav | 0 | 6368 | <reponame>rhyswhitley/savanna_iav
#!/usr/bin/env python
import os
from collections import OrderedDict
import cPickle as pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.cm import get_cmap
from matplotlib import style
from scipy import ... | #!/usr/bin/env python
import os
from collections import OrderedDict
import cPickle as pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.cm import get_cmap
from matplotlib import style
from scipy import stats
from scipy import integrate
... | en | 0.562122 | #!/usr/bin/env python # Stomatal conductance # Leaf transpiration # Leaf assimilation # **FOR LOOP WILL GO HERE | 2.527997 | 3 |
app/index.py | vprnet/school-closings | 0 | 6369 | <reponame>vprnet/school-closings
#!/usr/local/bin/python2.7
from flask import Flask
import sys
from flask_frozen import Freezer
from upload_s3 import set_metadata
from config import AWS_DIRECTORY
app = Flask(__name__)
app.config.from_object('config')
from views import *
# Serving from s3 leads to some complications... | #!/usr/local/bin/python2.7
from flask import Flask
import sys
from flask_frozen import Freezer
from upload_s3 import set_metadata
from config import AWS_DIRECTORY
app = Flask(__name__)
app.config.from_object('config')
from views import *
# Serving from s3 leads to some complications in how static files are served
i... | en | 0.94543 | #!/usr/local/bin/python2.7 # Serving from s3 leads to some complications in how static files are served | 2.203336 | 2 |
proxyclient/linux.py | modwizcode/m1n1 | 1 | 6370 | <filename>proxyclient/linux.py
#!/usr/bin/python
from setup import *
payload = open(sys.argv[1], "rb").read()
dtb = open(sys.argv[2], "rb").read()
if len(sys.argv) > 3:
initramfs = open(sys.argv[3], "rb").read()
initramfs_size = len(initramfs)
else:
initramfs = None
initramfs_size = 0
compressed_size... | <filename>proxyclient/linux.py
#!/usr/bin/python
from setup import *
payload = open(sys.argv[1], "rb").read()
dtb = open(sys.argv[2], "rb").read()
if len(sys.argv) > 3:
initramfs = open(sys.argv[3], "rb").read()
initramfs_size = len(initramfs)
else:
initramfs = None
initramfs_size = 0
compressed_size... | en | 0.286525 | #!/usr/bin/python #kernel_size = p.xzdec(compressed_addr, compressed_size) #if kernel_size < 0: #raise Exception("Decompression header check error!",) #print("Uncompressed kernel size: %d bytes" % kernel_size) | 2.121521 | 2 |
src/server.py | shizhongpwn/ancypwn | 1 | 6371 | <reponame>shizhongpwn/ancypwn<filename>src/server.py
import json
import os
import multiprocessing
import struct
import importlib
from socketserver import TCPServer, StreamRequestHandler
def plugin_module_import(name):
try:
return importlib.import_module(name)
except ModuleNotFoundError as e:
p... | import json
import os
import multiprocessing
import struct
import importlib
from socketserver import TCPServer, StreamRequestHandler
def plugin_module_import(name):
try:
return importlib.import_module(name)
except ModuleNotFoundError as e:
prompt = 'plugin {} not found, please install it first... | none | 1 | 2.161721 | 2 | |
pytorch_utils/collection_utils.py | c-hofer/pytorch_utils | 0 | 6372 | <reponame>c-hofer/pytorch_utils
def keychain_value_iter(d, key_chain=None, allowed_values=None):
key_chain = [] if key_chain is None else list(key_chain).copy()
if not isinstance(d, dict):
if allowed_values is not None:
assert isinstance(d, allowed_values), 'Value needs to be of type {}!'.f... | def keychain_value_iter(d, key_chain=None, allowed_values=None):
key_chain = [] if key_chain is None else list(key_chain).copy()
if not isinstance(d, dict):
if allowed_values is not None:
assert isinstance(d, allowed_values), 'Value needs to be of type {}!'.format(
allowed_v... | none | 1 | 2.835546 | 3 | |
speech_to_text/views.py | zace3d/video_analysis | 0 | 6373 | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from . import helpers
# Create your views here.
@csrf_exempt
def convert_video(request, version):
# Get video
video = reques... | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from . import helpers
# Create your views here.
@csrf_exempt
def convert_video(request, version):
# Get video
video = reques... | en | 0.684876 | # Create your views here. # Get video # Transcribe video and extract audio # return render(request, 'api/v1/result_successful.html', context) | 1.867302 | 2 |
security_monkey/watchers/vpc/vpn.py | boladmin/security_monkey | 4,258 | 6374 | <reponame>boladmin/security_monkey
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | en | 0.773259 | # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ... | 2.125262 | 2 |
particle.py | coush001/Imperial-MSc-Group-Project-2 | 0 | 6375 | from itertools import count
import numpy as np
class Particle(object):
"""Object containing all the properties for a single particle"""
_ids = count(0)
def __init__(self, main_data=None, x=np.zeros(2)):
self.id = next(self._ids)
self.main_data = main_data
self.x = np.array(x)
... | from itertools import count
import numpy as np
class Particle(object):
"""Object containing all the properties for a single particle"""
_ids = count(0)
def __init__(self, main_data=None, x=np.zeros(2)):
self.id = next(self._ids)
self.main_data = main_data
self.x = np.array(x)
... | en | 0.762178 | Object containing all the properties for a single particle # initial mass depends on the initial particle spacing # Particle by default is not on the boundary # For predictor corrector Calculates the 2D integer index for the particle's location in the search grid # Calculates the bucket coordinates Equation of state ... | 3.01091 | 3 |
app/main/form.py | hussein18149/PITCHBOARD | 0 | 6376 | <reponame>hussein18149/PITCHBOARD
from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField
from wtforms.validators import Required
class UpdateProfile(FlaskForm):
about = TextAreaField('Tell us about you.',validators = [Required()])
submit = SubmitField('Submit')
class PitchFo... | from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField
from wtforms.validators import Required
class UpdateProfile(FlaskForm):
about = TextAreaField('Tell us about you.',validators = [Required()])
submit = SubmitField('Submit')
class PitchForm(FlaskForm):
pitch = TextAre... | none | 1 | 2.662508 | 3 | |
soar_instruments/sami/adclass.py | soar-telescope/dragons-soar | 1 | 6377 | <reponame>soar-telescope/dragons-soar
import re
import astrodata
from astrodata import (astro_data_tag, TagSet, astro_data_descriptor,
returns_list)
from astrodata.fits import FitsLoader, FitsProvider
from ..soar import AstroDataSOAR
class AstroDataSAMI(AstroDataSOAR):
__keyword_dict = di... | import re
import astrodata
from astrodata import (astro_data_tag, TagSet, astro_data_descriptor,
returns_list)
from astrodata.fits import FitsLoader, FitsProvider
from ..soar import AstroDataSOAR
class AstroDataSAMI(AstroDataSOAR):
__keyword_dict = dict(data_section='DATASEC', gain='GAIN'... | en | 0.902502 | # QUESTIONS: # 1) is SAMI always used with the SAM AO? # 2) is SAMI used only at one telescopes or multiple ones? # ANSWER: # 1) SAMI is always used withing SAM but not always with AO. # 2) SAMI and SAM are only used at SOAR Telescope. # Ideally, we would want 'IMAGE' to be set by the 'IMAGE' tag. # But since OBSTYPE i... | 2.6165 | 3 |
practice/src/design_pattern/TemplateMethod.py | t10471/python | 0 | 6378 | # -*- coding: utf-8 -*-
#単なる継承
class Base(object):
def __init__(self):
pass
def meth(self, int):
return self._meth(int)
def _meth(self, int):
return int
class Pow(Base):
def _meth(self, int):
return pow(int,int)
| # -*- coding: utf-8 -*-
#単なる継承
class Base(object):
def __init__(self):
pass
def meth(self, int):
return self._meth(int)
def _meth(self, int):
return int
class Pow(Base):
def _meth(self, int):
return pow(int,int)
| en | 0.320867 | # -*- coding: utf-8 -*- #単なる継承 | 3.391287 | 3 |
yoon/stage1_kernel.py | yoon28/realsr-noise-injection | 17 | 6379 | <reponame>yoon28/realsr-noise-injection
import os, sys
import numpy as np
import cv2
import random
import torch
from configs import Config
from kernelGAN import KernelGAN
from data import DataGenerator
from learner import Learner
import tqdm
DATA_LOC = "/mnt/data/NTIRE2020/realSR/track2" # "/mnt/data/NTIRE2020/real... | import os, sys
import numpy as np
import cv2
import random
import torch
from configs import Config
from kernelGAN import KernelGAN
from data import DataGenerator
from learner import Learner
import tqdm
DATA_LOC = "/mnt/data/NTIRE2020/realSR/track2" # "/mnt/data/NTIRE2020/realSR/track1"
DATA_X = "DPEDiphone-tr-x" # ... | en | 0.594442 | # "/mnt/data/NTIRE2020/realSR/track1" # "Corrupted-tr-x" # "Corrupted-tr-y" # "Corrupted-va-x" # exit(0) | 2.038964 | 2 |
test/rdfa/test_non_xhtml.py | RDFLib/PyRDFa | 8 | 6380 | from unittest import TestCase
from pyRdfa import pyRdfa
class NonXhtmlTest(TestCase):
"""
RDFa that is in not well-formed XHTML is passed through html5lib.
These tests make sure that this RDFa can be processed both from
a file, and from a URL.
"""
target1 = '<og:isbn>9780596516499</og:isbn>'... | from unittest import TestCase
from pyRdfa import pyRdfa
class NonXhtmlTest(TestCase):
"""
RDFa that is in not well-formed XHTML is passed through html5lib.
These tests make sure that this RDFa can be processed both from
a file, and from a URL.
"""
target1 = '<og:isbn>9780596516499</og:isbn>'... | en | 0.954535 | RDFa that is in not well-formed XHTML is passed through html5lib. These tests make sure that this RDFa can be processed both from a file, and from a URL. | 3.05185 | 3 |
python/pyoai/setup.py | jr3cermak/robs-kitchensink | 0 | 6381 | <reponame>jr3cermak/robs-kitchensink
from setuptools import setup, find_packages
from os.path import join, dirname
setup(
name='pyoai',
version='2.4.6.b',
author='Infrae',
author_email='<EMAIL>',
url='https://github.com/jr3cermak/robs-kitchensink/tree/master/python/pyoai',
classifiers=["Develop... | from setuptools import setup, find_packages
from os.path import join, dirname
setup(
name='pyoai',
version='2.4.6.b',
author='Infrae',
author_email='<EMAIL>',
url='https://github.com/jr3cermak/robs-kitchensink/tree/master/python/pyoai',
classifiers=["Development Status :: 4 - Beta",
... | en | 0.586431 | \ The oaipmh module is a Python implementation of an "Open Archives Initiative Protocol for Metadata Harvesting" (version 2) client and server. The protocol is described here: http://www.openarchives.org/OAI/openarchivesprotocol.html | 1.644535 | 2 |
utils/functions.py | Roozbeh-Bazargani/CPSC-533R-project | 0 | 6382 | <filename>utils/functions.py
import torch
from torch import nn
import math
#0 left hip
#1 left knee
#2 left foot
#3 right hip
#4 right knee
#5 right foot
#6 middle hip
#7 neck
#8 nose
#9 head
#10 left shoulder
#11 left elbow
#12 left wrist
#13 right shoulder
#14 right elbow
#15 right wrist
def random_rotation(J3d):
... | <filename>utils/functions.py
import torch
from torch import nn
import math
#0 left hip
#1 left knee
#2 left foot
#3 right hip
#4 right knee
#5 right foot
#6 middle hip
#7 neck
#8 nose
#9 head
#10 left shoulder
#11 left elbow
#12 left wrist
#13 right shoulder
#14 right elbow
#15 right wrist
def random_rotation(J3d):
... | en | 0.623857 | #0 left hip #1 left knee #2 left foot #3 right hip #4 right knee #5 right foot #6 middle hip #7 neck #8 nose #9 head #10 left shoulder #11 left elbow #12 left wrist #13 right shoulder #14 right elbow #15 right wrist # need copy???? # random theta # joint 8 = nose is root # need these values in the code # rotation over ... | 2.546563 | 3 |
Desafio Python/Aula 22 des109.py | ayresmajor/Curso-python | 0 | 6383 | from des109 import moeda
preco = float(input('Digite o preço pretendido: €'))
print(f'''A metade do preço é {(moeda.metade(preco))}
O dobro do preço é {(moeda.dobra(preco))}
Aumentando o preço 10% temos {(moeda.aumentar(preco, 10))}
Diminuindo o preço 13% temos {(moeda.aumentar(preco, 13))}''')
| from des109 import moeda
preco = float(input('Digite o preço pretendido: €'))
print(f'''A metade do preço é {(moeda.metade(preco))}
O dobro do preço é {(moeda.dobra(preco))}
Aumentando o preço 10% temos {(moeda.aumentar(preco, 10))}
Diminuindo o preço 13% temos {(moeda.aumentar(preco, 13))}''')
| pt | 0.915795 | A metade do preço é {(moeda.metade(preco))} O dobro do preço é {(moeda.dobra(preco))} Aumentando o preço 10% temos {(moeda.aumentar(preco, 10))} Diminuindo o preço 13% temos {(moeda.aumentar(preco, 13))} | 3.432426 | 3 |
Chapter13_code/ch13_r05_using_the_rpc_api/xmlrpc.py | PacktPublishing/Odoo-Development-Cookbook | 55 | 6384 | #!/usr/bin/env python2
import xmlrpclib
db = 'odoo9'
user = 'admin'
password = '<PASSWORD>'
uid = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/2/common')\
.authenticate(db, user, password, {})
odoo = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/2/object')
installed_modules = odoo.execute_kw(
db, ... | #!/usr/bin/env python2
import xmlrpclib
db = 'odoo9'
user = 'admin'
password = '<PASSWORD>'
uid = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/2/common')\
.authenticate(db, user, password, {})
odoo = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/2/object')
installed_modules = odoo.execute_kw(
db, ... | ru | 0.196695 | #!/usr/bin/env python2 | 2.327409 | 2 |
python/zzz/v1-all_feat_cnn/components/features.py | emorynlp/character-identification-old | 1 | 6385 | <reponame>emorynlp/character-identification-old<gh_stars>1-10
from abc import *
import numpy as np
###########################################################
class AbstractFeatureExtractor(object):
@abstractmethod
def extract(self, object):
return
###################################################... | from abc import *
import numpy as np
###########################################################
class AbstractFeatureExtractor(object):
@abstractmethod
def extract(self, object):
return
###########################################################
class EntityFeatureExtractor(AbstractFeatureExtractor... | en | 0.651274 | ########################################################### ########################################################### ########################################################### # Word embeddings of the head word # First word of the mention # Last word of the mention # Avg of all words in the mention # Two preceding ... | 2.735624 | 3 |
ufdl-core-app/src/ufdl/core_app/models/mixins/_UserRestrictedQuerySet.py | waikato-ufdl/ufdl-backend | 0 | 6386 | from django.db import models
class UserRestrictedQuerySet(models.QuerySet):
"""
Query-set base class for models which apply per-instance permissions
based on the user accessing them.
"""
def for_user(self, user):
"""
Filters the query-set to those instances that the
given u... | from django.db import models
class UserRestrictedQuerySet(models.QuerySet):
"""
Query-set base class for models which apply per-instance permissions
based on the user accessing them.
"""
def for_user(self, user):
"""
Filters the query-set to those instances that the
given u... | en | 0.913031 | Query-set base class for models which apply per-instance permissions based on the user accessing them. Filters the query-set to those instances that the given user is allowed to access. :param user: The user. :return: The filtered query-set. | 2.549893 | 3 |
sdk/python/pulumi_azure_native/eventgrid/partner_registration.py | sebtelko/pulumi-azure-native | 0 | 6387 | # 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
from... | # 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
from... | en | 0.748614 | # 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! *** The set of arguments for constructing a PartnerRegistration resource. :param pulumi.Input[str] resource_group_name: The name of the resource gro... | 1.565562 | 2 |
_ar/masking_provement.py | TomKingsfordUoA/ResidualMaskingNetwork | 242 | 6388 | import os
import glob
import cv2
import numpy as np
import torch
from torchvision.transforms import transforms
from natsort import natsorted
from models import resmasking_dropout1
from utils.datasets.fer2013dataset import EMOTION_DICT
from barez import show
transform = transforms.Compose(
[
transforms.ToPI... | import os
import glob
import cv2
import numpy as np
import torch
from torchvision.transforms import transforms
from natsort import natsorted
from models import resmasking_dropout1
from utils.datasets.fer2013dataset import EMOTION_DICT
from barez import show
transform = transforms.Compose(
[
transforms.ToPI... | en | 0.302111 | # state = torch.load('./saved/checkpoints/resmasking_dropout1_rot30_2019Nov17_14.33') # image_path = '/home/z/research/bkemo/images/disgust/0.0_dc10a3_1976_0.png' # output = model(tensor) # 112 # 56 # 56 # 28 # 14 # heat_2 = activations_mask(m) # 7 # print(np.sum(heat_1 - heat_2)) # show(np.concatenate((image, heat_1, ... | 2.366513 | 2 |
Python/Gerenciador de pagamentos.py | Kauan677/Projetos-Python | 1 | 6389 | <gh_stars>1-10
import time
import colorama
def gerenciador_de_pagamento():
preço = float(str(input('Preço das compras: R$')))
print('''Escolha de pagamento:
[ 1 ]A vista dinheiro/cheque: 10% de desconto.
[ 2 ]A vista no cartão: 5% de desconto.
[ 3 ]Em até duas 2x no cartão: preço formal.
[ 4 ]3x... | import time
import colorama
def gerenciador_de_pagamento():
preço = float(str(input('Preço das compras: R$')))
print('''Escolha de pagamento:
[ 1 ]A vista dinheiro/cheque: 10% de desconto.
[ 2 ]A vista no cartão: 5% de desconto.
[ 3 ]Em até duas 2x no cartão: preço formal.
[ 4 ]3x ou mais no car... | pt | 0.982123 | Escolha de pagamento: [ 1 ]A vista dinheiro/cheque: 10% de desconto. [ 2 ]A vista no cartão: 5% de desconto. [ 3 ]Em até duas 2x no cartão: preço formal. [ 4 ]3x ou mais no cartão: 20% de juros. | 3.683721 | 4 |
src/scs_core/osio/data/abstract_topic.py | seoss/scs_core | 3 | 6390 | <gh_stars>1-10
"""
Created on 2 Apr 2017
@author: <NAME> (<EMAIL>)
"""
from collections import OrderedDict
from scs_core.data.json import JSONable
# --------------------------------------------------------------------------------------------------------------------
class AbstractTopic(JSONable):
"""
class... | """
Created on 2 Apr 2017
@author: <NAME> (<EMAIL>)
"""
from collections import OrderedDict
from scs_core.data.json import JSONable
# --------------------------------------------------------------------------------------------------------------------
class AbstractTopic(JSONable):
"""
classdocs
"""
... | en | 0.157446 | Created on 2 Apr 2017 @author: <NAME> (<EMAIL>) # -------------------------------------------------------------------------------------------------------------------- classdocs # ---------------------------------------------------------------------------------------------------------------- Constructor # string # stri... | 2.336105 | 2 |
sdk/python/pulumi_azure_native/notificationhubs/latest/get_namespace.py | pulumi-bot/pulumi-azure-native | 0 | 6391 | # 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
from ... import _utilities, _tables
from... | # 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
from ... import _utilities, _tables
from... | en | 0.755388 | # 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! *** The 'latest' version is deprecated. Please migrate to the function in the top-level module: 'azure-native:notificationhubs:getNamespace'. Description of... | 1.568121 | 2 |
chue/utils.py | naren-m/chue | 0 | 6392 | import json
from pygments import highlight
from pygments.lexers import JsonLexer
from pygments.formatters import TerminalFormatter
def print_json_obj(json_object):
json_str = json.dumps(json_object, indent=4, sort_keys=True)
print(highlight(json_str, JsonLexer(), TerminalFormatter()))
def print_json_str(jso... | import json
from pygments import highlight
from pygments.lexers import JsonLexer
from pygments.formatters import TerminalFormatter
def print_json_obj(json_object):
json_str = json.dumps(json_object, indent=4, sort_keys=True)
print(highlight(json_str, JsonLexer(), TerminalFormatter()))
def print_json_str(jso... | none | 1 | 2.516861 | 3 | |
selfdrive/car/chrysler/radar_interface.py | 919bot/Tessa | 85 | 6393 | #!/usr/bin/env python3
import os
from opendbc.can.parser import CANParser
from cereal import car
from selfdrive.car.interfaces import RadarInterfaceBase
RADAR_MSGS_C = list(range(0x2c2, 0x2d4+2, 2)) # c_ messages 706,...,724
RADAR_MSGS_D = list(range(0x2a2, 0x2b4+2, 2)) # d_ messages
LAST_MSG = max(RADAR_MSGS_C + RA... | #!/usr/bin/env python3
import os
from opendbc.can.parser import CANParser
from cereal import car
from selfdrive.car.interfaces import RadarInterfaceBase
RADAR_MSGS_C = list(range(0x2c2, 0x2d4+2, 2)) # c_ messages 706,...,724
RADAR_MSGS_D = list(range(0x2a2, 0x2b4+2, 2)) # d_ messages
LAST_MSG = max(RADAR_MSGS_C + RA... | en | 0.662376 | #!/usr/bin/env python3 # c_ messages 706,...,724 # d_ messages # list of [(signal name, message name or number, initial values), (...)] # [('RADAR_STATE', 1024, 0), # ('LONG_DIST', 1072, 255), # ('LONG_DIST', 1073, 255), # ('LONG_DIST', 1074, 255), # ('LONG_DIST', 1075, 255), # The factor and offset are applied by ... | 2.329106 | 2 |
mod/tools/ccmake.py | mattiasljungstrom/fips | 429 | 6394 | <gh_stars>100-1000
"""
wrapper for ccmake command line tool
"""
import subprocess
name = 'ccmake'
platforms = ['linux', 'osx']
optional = True
not_found = "required for 'fips config' functionality"
#-------------------------------------------------------------------------------
def check_exists(fips_dir) :
"""tes... | """
wrapper for ccmake command line tool
"""
import subprocess
name = 'ccmake'
platforms = ['linux', 'osx']
optional = True
not_found = "required for 'fips config' functionality"
#-------------------------------------------------------------------------------
def check_exists(fips_dir) :
"""test if ccmake is in t... | en | 0.432057 | wrapper for ccmake command line tool #------------------------------------------------------------------------------- test if ccmake is in the path :returns: True if ccmake is in the path #------------------------------------------------------------------------------- run ccmake to configure cmake project ... | 2.259985 | 2 |
image_quality/handlers/data_generator.py | mbartoli/image-quality-assessment | 1 | 6395 |
import os
import numpy as np
import tensorflow as tf
from image_quality.utils import utils
class TrainDataGenerator(tf.keras.utils.Sequence):
'''inherits from Keras Sequence base object, allows to use multiprocessing in .fit_generator'''
def __init__(self, samples, img_dir, batch_size, n_classes, basenet_preproc... |
import os
import numpy as np
import tensorflow as tf
from image_quality.utils import utils
class TrainDataGenerator(tf.keras.utils.Sequence):
'''inherits from Keras Sequence base object, allows to use multiprocessing in .fit_generator'''
def __init__(self, samples, img_dir, batch_size, n_classes, basenet_preproc... | en | 0.707552 | inherits from Keras Sequence base object, allows to use multiprocessing in .fit_generator # Keras basenet specific preprocessing function # dimensions that images get resized into when loaded # dimensions that images get randomly cropped to # call ensures that samples are shuffled in first epoch if shuffle is set to Tr... | 2.856769 | 3 |
codewars/4 kyu/strip-comments.py | sirken/coding-practice | 0 | 6396 | from Test import Test, Test as test
'''
Complete the solution so that it strips all text that follows any of a set of comment markers passed in. Any whitespace at the end of the line should also be stripped out.
Example:
Given an input string of:
apples, pears # and bananas
grapes
bananas !apples
The output expecte... | from Test import Test, Test as test
'''
Complete the solution so that it strips all text that follows any of a set of comment markers passed in. Any whitespace at the end of the line should also be stripped out.
Example:
Given an input string of:
apples, pears # and bananas
grapes
bananas !apples
The output expecte... | en | 0.820882 | Complete the solution so that it strips all text that follows any of a set of comment markers passed in. Any whitespace at the end of the line should also be stripped out. Example: Given an input string of: apples, pears # and bananas grapes bananas !apples The output expected would be: apples, pears grapes bananas... | 4.126571 | 4 |
qat/interop/qiskit/quantum_channels.py | myQLM/myqlm-interop | 5 | 6397 | # -*- coding: utf-8 -*-
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Versi... | # -*- coding: utf-8 -*-
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Versi... | en | 0.79484 | # -*- coding: utf-8 -*- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (t... | 2.099681 | 2 |
mne_nirs/simulation/_simulation.py | mshader/mne-nirs | 0 | 6398 | <reponame>mshader/mne-nirs
# Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import numpy as np
from mne import Annotations, create_info
from mne.io import RawArray
def simulate_nirs_raw(sfreq=3., amplitude=1.,
sig_dur=300., stim_dur=5.,
isi_min=15., isi_max=45.):
... | # Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import numpy as np
from mne import Annotations, create_info
from mne.io import RawArray
def simulate_nirs_raw(sfreq=3., amplitude=1.,
sig_dur=300., stim_dur=5.,
isi_min=15., isi_max=45.):
"""
Create simulated ... | en | 0.722893 | # Authors: <NAME> <<EMAIL>> # # License: BSD (3-clause) Create simulated data. .. warning:: Work in progress: I am trying to think on the best API. Parameters ---------- sfreq : Number The sample rate. amplitude : Number The amplitude of the signal to simulate in uM. sig_dur ... | 2.35487 | 2 |
build/lib/dataaccess/TransactionRepository.py | athanikos/cryptodataaccess | 0 | 6399 | <gh_stars>0
from cryptomodel.cryptostore import user_notification, user_channel, user_transaction, operation_type
from mongoengine import Q
from cryptodataaccess import helpers
from cryptodataaccess.helpers import if_none_raise, if_none_raise_with_id
class TransactionRepository:
def __init__(self, config, log_e... | from cryptomodel.cryptostore import user_notification, user_channel, user_transaction, operation_type
from mongoengine import Q
from cryptodataaccess import helpers
from cryptodataaccess.helpers import if_none_raise, if_none_raise_with_id
class TransactionRepository:
def __init__(self, config, log_error):
... | none | 1 | 2.256847 | 2 |