function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def get_pipeline_run_config(self, pipe_name, pipe_version):
"""Return a filepath for the config to be used or None."""
return None | MetaSUB/ModuleUltra | [
1,
1,
1,
1,
1506196367
] |
def get_daemon_config_filename(ctype):
try:
return environ['MODULE_ULTRA_DAEMON_CONFIG']
except KeyError:
config_dir = ModuleUltraConfig.getConfigDir()
config_filename = join(config_dir, 'daemon_config.yaml')
if isfile(config_filename):
ret... | MetaSUB/ModuleUltra | [
1,
1,
1,
1,
1506196367
] |
def gpio_init(pin, output):
try:
with open(f"/sys/class/gpio/gpio{pin}/direction", 'wb') as f:
f.write(b"out" if output else b"in")
except Exception as e:
print(f"Failed to set gpio {pin} direction: {e}") | commaai/openpilot | [
38913,
7077,
38913,
364,
1479951210
] |
def setUp(self):
self.user = 'leo'
self.core_url = "https://api.navitia.io/v1/"
self.client = navitia_client.Client(self.user)
self.coords = '2.333333;48.866667' | leonardbinet/navitia_client | [
9,
3,
9,
2,
1481535827
] |
def initAlgorithm(self, config):
"""
Parameter setting.
"""
self.addParameter(
QgsProcessingParameterMultipleLayers(
self.INPUT_LAYERS,
self.tr('Input Layers'),
QgsProcessing.TypeVector
)
)
self.addPa... | lcoandrade/DsgTools | [
42,
22,
42,
15,
1412914139
] |
def getLayerRootNode(self, lyr, rootNode):
"""
Finds the database name of the layer and creates (if not exists)
a node with the found name.
lyr: (QgsVectorLayer)
rootNode: (node item)
"""
uriText = lyr.dataProvider().dataSourceUri()
candidateUri = QgsDataS... | lcoandrade/DsgTools | [
42,
22,
42,
15,
1412914139
] |
def getLayerCategoryNode(self, lyr, rootNode, categoryExpression):
"""
Finds category node based on category expression
and creates it (if not exists a node)
"""
exp = QgsExpression(categoryExpression)
context = QgsExpressionContext()
context.appendScopes(
... | lcoandrade/DsgTools | [
42,
22,
42,
15,
1412914139
] |
def name(self):
"""
Returns the algorithm name, used for identifying the algorithm. This
string should be fixed for the algorithm, and must not be localised.
The name should be unique within each provider. Names should contain
lowercase alphanumeric characters only and no spaces ... | lcoandrade/DsgTools | [
42,
22,
42,
15,
1412914139
] |
def group(self):
"""
Returns the name of the group this algorithm belongs to. This string
should be localised.
"""
return self.tr('Layer Management Algorithms') | lcoandrade/DsgTools | [
42,
22,
42,
15,
1412914139
] |
def tr(self, string):
"""
Translates input string.
"""
return QCoreApplication.translate('GroupLayersAlgorithm', string) | lcoandrade/DsgTools | [
42,
22,
42,
15,
1412914139
] |
def doc_root(port_obj):
doc_root = port_obj.get_option("wptserver_doc_root")
if doc_root is None:
return port_obj.host.filesystem.join("imported", "w3c", "web-platform-tests")
return doc_root | teamfx/openjfx-9-dev-rt | [
1,
2,
1,
2,
1494141092
] |
def __init__(self, port_obj, name, pidfile=None):
http_server_base.HttpServerBase.__init__(self, port_obj)
self._output_dir = port_obj.results_directory()
self._name = name
self._log_file_name = '%s_process_log.out.txt' % (self._name)
self._wsout = None
self._process = ... | teamfx/openjfx-9-dev-rt | [
1,
2,
1,
2,
1494141092
] |
def _copy_webkit_test_files(self):
_log.debug('Copying WebKit resources files')
for f in self._resources_files_to_copy:
webkit_filename = self._filesystem.join(self._layout_root, "resources", f)
if self._filesystem.isfile(webkit_filename):
self._filesystem.copyfil... | teamfx/openjfx-9-dev-rt | [
1,
2,
1,
2,
1494141092
] |
def _prepare_config(self):
if self._filesystem.exists(self._output_dir):
output_log = self._filesystem.join(self._output_dir, self._log_file_name)
self._wsout = self._filesystem.open_text_file_for_writing(output_log)
self._install_modules()
self._copy_webkit_test_files() | teamfx/openjfx-9-dev-rt | [
1,
2,
1,
2,
1494141092
] |
def _stop_running_subservers(self):
if self._filesystem.exists(self._servers_file):
try:
json_data = self._filesystem.read_text_file(self._servers_file)
started_servers = json.loads(json_data)
for server in started_servers:
if self.... | teamfx/openjfx-9-dev-rt | [
1,
2,
1,
2,
1494141092
] |
def __init__(self):
self.net = common.Net() | felipenaselva/felipe.repository | [
2,
6,
2,
1,
1474110890
] |
def __replaceQuality(self, qual):
return self.qual_map.get(qual.lower(), '000') | felipenaselva/felipe.repository | [
2,
6,
2,
1,
1474110890
] |
def __init__(self):
"""Init the effect library and get options from gui."""
inkex.Effect.__init__(self)
self.OptionParser.add_option("-t", "--width",
action="store", type="int",
dest="width", default=200,
... | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | [
9,
2,
9,
2,
1501822197
] |
def draw_rectangle(self,(x, y), (l,b), color, parent, id_): | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | [
9,
2,
9,
2,
1501822197
] |
def draw_circle(self,(x, y), r, color, parent, id_): | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | [
9,
2,
9,
2,
1501822197
] |
def draw_ellipse(self,(x, y), (r1,r2), color, parent, id_,transform): | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | [
9,
2,
9,
2,
1501822197
] |
def draw_svg(self,output,parent):
startu = 0
endu = 0
for i in range(len(output)):
for j in range(len(output[i])):
if (output[i][j]==0):
self.draw_circle((int((startu+startu+1)/2),int((endu+endu+1)/2)),1,'black',parent,'id')
#dw... | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | [
9,
2,
9,
2,
1501822197
] |
def intensity(self,arr): | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | [
9,
2,
9,
2,
1501822197
] |
def order_dither(self,image):
arr = np.asarray(image)
brr = self.intensity(arr)
crr = [[8, 3, 4], [6, 1, 2], [7, 5, 9]]
drr = np.zeros((len(arr),len(arr[0])))
for i in range(len(arr)):
for j in range(len(arr[0])):
if(brr[i][j] > crr[i%3][j%3]):
... | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | [
9,
2,
9,
2,
1501822197
] |
def exportPage(self, curfile, outfile):
command = "%s %s --export-png %s" %(self.options.inkscape_path,curfile,outfile)
p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return_code = p.wait()
f = p.stdout
err = p.stderr
img = Image... | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | [
9,
2,
9,
2,
1501822197
] |
def main():
e = ordered_dithering()
e.affect()
exit() | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | [
9,
2,
9,
2,
1501822197
] |
def Riffle(filenames,vb=False):
if vb: print "Looking at",len(filenames),"files: ",filenames
# Break down file names. Naming convention: fruit_flavor.fits
fruits = []
flavors = []
for filename in set(filenames):
pieces = string.split(filename,'_')
fruits.append(string.join(pieces[0:-1],'_')... | davidwhogg/LensTractor | [
5,
4,
5,
15,
1330532514
] |
def Deal(scifiles,varfiles,SURVEY='PS1',vb=False):
images = []
bands = []
epochs = []
centroids = []
total_mags = [] | davidwhogg/LensTractor | [
5,
4,
5,
15,
1330532514
] |
def Read_in_data(scifile,varfile,SURVEY='PS1',vb=False):
hdulist = pyfits.open(scifile)
sci = hdulist[0].data
hdr = hdulist[0].header
hdulist.close()
NX,NY = sci.shape
if (varfile is not None):
hdulist = pyfits.open(varfile)
var = hdulist[0].data
hdulist.close()
else:
# M... | davidwhogg/LensTractor | [
5,
4,
5,
15,
1330532514
] |
def Initial_PSF(FWHM,double=False):
# NB. FWHM of PSF is given in pixels.
if not double:
# Single Gaussian default:
w = np.array([1.0]) # amplitude at peak
mu = np.array([[0.0,0.0]]) # centroid position in pixels
var = (FWHM/2.35)**2.0
cov = np.a... | davidwhogg/LensTractor | [
5,
4,
5,
15,
1330532514
] |
def Turnover(allbands,allmagnitudes,allcentroids,vb=False):
# Models need good initial fluxes to avoid wasting time getting these
# right. Take a quick look at the data to do this:
# 1) Get rough idea of object position from wcs of first image - works
# OK if all images are the same size and well ... | davidwhogg/LensTractor | [
5,
4,
5,
15,
1330532514
] |
def __init__(self, editor):
"""
Constructor.
Arguments:
editor -- A qtquiedit object.
"""
self.editor = editor
self.themeDict = yaml.load(open(self.editor.get_resource( \
u'themes.yaml')).read())
self.theme = self.recTheme(self.editor.theme) | smathot/quiedit | [
6,
3,
6,
1,
1310495698
] |
def font(self):
"""
Gives the theme font.
Returns:
A QFont.
"""
font = QtGui.QFont()
font.setPointSize(int(self.theme[u'font_size']))
font.setFamily(self.theme[u'font_family'])
return font | smathot/quiedit | [
6,
3,
6,
1,
1310495698
] |
def forwards(self, orm):
# Adding model 'FormPlugin'
db.create_table(u'cmsplugin_formplugin', (
(u'cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)),
('form_class', self.gf('django.db.models.fields.Ch... | metzlar/cms-form-plugin | [
4,
5,
4,
1,
1390944245
] |
def main():
goToLineCol(bRepeatPrompt = True,
iEdgeBuffer = 5,
iCaretHiliteDuration = 5,
bCallTipAutoHide = False,
bBraceHilite = True) | bruderstein/PythonScript | [
310,
62,
310,
74,
1280013973
] |
def promptValue(sInfoText, sTitleText, sDefaultVal, iMinVal, iMaxVal, sRangeError, bRepeatPrompt):
while True:
sNewVal = notepad.prompt(sInfoText, sTitleText, sDefaultVal)
if sNewVal == None:
return None
try:
iNewVal = int(sNewVal)
if iMinVal <= iNewVal <= iMaxVal:
... | bruderstein/PythonScript | [
310,
62,
310,
74,
1280013973
] |
def __init__(self, applet):
self.applet = applet
self.dialog = Gtk.Dialog("Workspace Name Applet Preferences",
None,
Gtk.DialogFlags.DESTROY_WITH_PARENT,
(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE))
... | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def __init__(self, applet):
Gtk.Widget.__init__(self)
self.connect("activate", self._on_activate)
self.connect("key-release-event", self._on_key_release)
self.applet = applet | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def _on_key_release(self, widget, event):
if event.keyval == Gdk.KEY_Escape:
self.applet.exit_editing() | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def __init__(self, applet):
self.applet = applet;
menuxml = """
<menuitem name="Prefs" action="Prefs" />
<menuitem name="About" action="About" /> | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def _display_about(self, action):
about = Gtk.AboutDialog()
about.set_program_name("Workspace Name Applet")
about.set_version(wsnamelet_globals.version)
about.set_copyright("© 2006 - 2015 Alexandre Muñiz")
about.set_comments("View and change the name of the current workspace.\n\n... | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def set_width(self, width):
self.width = width
self.button.set_size_request(width, -1)
self.button.queue_resize()
self.entry.set_size_request(width, -1)
self.entry.queue_resize() | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def init(self):
self.button = Gtk.Button()
self.button.connect("button-press-event", self._on_button_press)
self.button.connect("button-release-event", self._on_button_release)
self.label = Gtk.Label()
self.label.set_ellipsize(Pango.EllipsizeMode.END)
self.applet.add(self... | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def _on_button_release(self, button, event, data=None):
if event.type == Gdk.EventType.BUTTON_RELEASE and event.button == 1:
self.editing = True
self.applet.remove(self.button)
self.applet.add(self.entry)
self.entry.set_text(self.workspace.get_name())
... | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def _on_workspace_changed(self, event, old_workspace):
if self.editing:
self.exit_editing()
if (self._name_change_handler_id):
self.workspace.disconnect(self._name_change_handler_id)
self.workspace = really_get_active_workspace(self.screen)
self._name_change_h... | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def show_workspace_name(self):
if self.workspace:
self.label.set_text(self.workspace.get_name())
self.applet.show_all() | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def really_get_active_workspace(screen):
# This bit is needed because wnck is asynchronous.
while Gtk.events_pending():
Gtk.main_iteration()
return screen.get_active_workspace() | munizao/mate-workspace-name-applet | [
1,
1,
1,
2,
1424054871
] |
def __init__(self, group_paths=ALL_GROUP_PATHS):
self.locale = Locale.get_locale()
self.translator = CustomTranslator()
self.paths = group_paths
self.groups = {}
self._fill_groups_list() | nextgis/quickmapservices | [
143,
44,
143,
33,
1416824373
] |
def _read_ini_file(self, root, ini_file_path, category):
try:
ini_full_path = os.path.join(root, ini_file_path)
parser = configparser.ConfigParser()
with codecs.open(ini_full_path, 'r', 'utf-8') as ini_file: | nextgis/quickmapservices | [
143,
44,
143,
33,
1416824373
] |
def get_group_menu(self, group_id):
if group_id in self.groups:
return self.groups[group_id].menu
else:
info = GroupInfo(group_id=group_id, menu=QMenu(group_id))
self.groups[group_id] = info
return info.menu | nextgis/quickmapservices | [
143,
44,
143,
33,
1416824373
] |
def wait_for_ansible(appliance):
appliance.server.settings.enable_server_roles("embedded_ansible")
appliance.wait_for_embedded_ansible()
yield
appliance.server.settings.disable_server_roles("embedded_ansible") | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def ansible_repository(appliance, wait_for_ansible):
repositories = appliance.collections.ansible_repositories
try:
repository = repositories.create(
name=fauxfactory.gen_alpha(),
url=cfme_data.ansible_links.playbook_repositories.embedded_ansible,
description=fauxfact... | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def ansible_catalog_item(appliance, ansible_repository):
cat_item = appliance.collections.catalog_items.create(
appliance.collections.catalog_items.ANSIBLE_PLAYBOOK,
fauxfactory.gen_alphanumeric(),
fauxfactory.gen_alphanumeric(),
display_in_catalog=True,
provisioning={
... | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def ansible_action(appliance, ansible_catalog_item):
action_collection = appliance.collections.actions
action = action_collection.create(
fauxfactory.gen_alphanumeric(),
action_type="Run Ansible Playbook",
action_values={
"run_ansible_playbook": {
"playbook_ca... | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def policy_for_testing(appliance, full_template_vm_modscope, provider, ansible_action):
vm = full_template_vm_modscope
policy = appliance.collections.policies.create(
VMControlPolicy,
fauxfactory.gen_alpha(),
scope="fill_field(VM and Instance : Name, INCLUDES, {})".format(vm.name)
)
... | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def ansible_credential(wait_for_ansible, appliance, full_template_modscope):
credential = appliance.collections.ansible_credentials.create(
fauxfactory.gen_alpha(),
"Machine",
username=credentials[full_template_modscope.creds]["username"],
password=credentials[full_template_modscope.... | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def service_request(appliance, ansible_catalog_item):
request_desc = "Provisioning Service [{0}] from [{0}]".format(ansible_catalog_item.name)
_service_request = appliance.collections.requests.instantiate(request_desc)
yield _service_request
_service_request.delete_if_exists() | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def service(appliance, ansible_catalog_item):
service_ = MyService(appliance, ansible_catalog_item.name)
yield service_
if service_.exists:
service_.delete() | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def test_action_run_ansible_playbook_localhost(request, ansible_catalog_item, ansible_action,
policy_for_testing, full_template_vm_modscope, ansible_credential, service_request,
service):
"""Tests a policy with ansible playbook action against localhost.
Polarion:
assignee: sbulage
... | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def test_action_run_ansible_playbook_manual_address(request, ansible_catalog_item, ansible_action,
policy_for_testing, full_template_vm_modscope, ansible_credential, service_request,
service):
"""Tests a policy with ansible playbook action against manual address.
Polarion:
assignee: sbu... | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def test_action_run_ansible_playbook_target_machine(request, ansible_catalog_item, ansible_action,
policy_for_testing, full_template_vm_modscope, ansible_credential, service_request,
service):
"""Tests a policy with ansible playbook action against target machine.
Polarion:
assignee: sbu... | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def test_action_run_ansible_playbook_unavailable_address(request, ansible_catalog_item,
full_template_vm_modscope, ansible_action, policy_for_testing, ansible_credential,
service_request, service):
"""Tests a policy with ansible playbook action against unavailable address.
Polarion:
ass... | RedHatQE/cfme_tests | [
69,
165,
69,
133,
1360187957
] |
def call_3dfier(db, tile, schema_tiles,
pc_file_name, pc_tile_case, pc_dir,
table_index_pc, fields_index_pc,
table_index_footprint, fields_index_footprint, uniqueid,
extent_ewkb, clip_prefix, prefix_tile_footprint,
yml_dir, tile_out, output... | balazsdukai/batch3dfier | [
3,
1,
3,
7,
1498038705
] |
def find_pc_files(pc_tiles, pc_dir, pc_file_name, pc_tile_case):
"""Find pointcloud files in the file system when given a list of pointcloud tile names
"""
# Prepare AHN file names -------------------------------------------------
if pc_tile_case == "upper":
tiles = [pc_file_name.format(tile=t.u... | balazsdukai/batch3dfier | [
3,
1,
3,
7,
1498038705
] |
def extent_to_ewkb(db, table_index, file):
"""Reads a polygon from a file and returns its EWKB.
I didn't find a simple way to safely get SRIDs from the input geometry
with Shapely, therefore it is obtained from the database and the CRS of the
polygon is assumed to be the same as of the tile indexes.
... | balazsdukai/batch3dfier | [
3,
1,
3,
7,
1498038705
] |
def get_2Dtile_area(db, table_index):
"""Get the area of a 2D tile.
Note
----
Assumes that all tiles have equal area. Area is in units of the tile CRS.
Parameters
----------
db : db Class instance
table_index : list of str
{'schema' : str, 'table' : str} of the table of tile in... | balazsdukai/batch3dfier | [
3,
1,
3,
7,
1498038705
] |
def clip_2Dtiles(db, user_schema, schema_tiles, tiles, poly, clip_prefix,
fields_view):
"""Creates views for the clipped tiles.
Parameters
----------
db : db Class instance
user_schema: str
schema_tiles : str
tiles : list
poly : Shapely polygon
clip_prefix : str
... | balazsdukai/batch3dfier | [
3,
1,
3,
7,
1498038705
] |
def get_view_fields(db, user_schema, tile_views):
"""Get the fields in a 2D tile view
Parameters
----------
tile_views : list of str
Returns
-------
{'all' : list, 'geometry' : str}
"""
if len(tile_views) > 0:
schema_q = sql.Literal(user_schema)
view_q = sql.Litera... | balazsdukai/batch3dfier | [
3,
1,
3,
7,
1498038705
] |
def enumerate_ground_sensors(bones):
bone = bones.get('GroundSensor.Axle.Ft')
if bone is not None:
yield bone
for bone in bones:
if bone.name.startswith('GroundSensor.Ft'):
yield bone
bone = bones.get('GroundSensor.Axle.Bk')
if bone is not None:
yield ... | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def __init__(self):
self.layout.use_property_split = True
self.layout.use_property_decorate = False | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def is_car_rig(cls, context):
return context.object is not None and context.object.data is not None and 'Car Rig' in context.object.data | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def is_car_rig_generated(cls, context):
return cls.is_car_rig(context) and context.object.data['Car Rig'] | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def display_bake_section(self, context):
self.layout.operator(bake_operators.ANIM_OT_carSteeringBake.bl_idname)
self.layout.operator(bake_operators.ANIM_OT_carWheelsRotationBake.bl_idname)
self.layout.operator(bake_operators.ANIM_OT_carClearSteeringWheelsRotation.bl_idname) | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def display_ground_sensors_section(self, context):
for ground_sensor in enumerate_ground_sensors(context.object.pose.bones):
ground_projection_constraint = ground_sensor.constraints.get('Ground projection')
self.layout.label(text=ground_sensor.name, icon='BONE_DATA')
if groun... | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def poll(cls, context):
return RIGACAR_PT_mixin.is_car_rig(context) | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def poll(cls, context):
return RIGACAR_PT_mixin.is_car_rig_generated(context) | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def poll(cls, context):
return RIGACAR_PT_mixin.is_car_rig(context) | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def poll(cls, context):
return RIGACAR_PT_mixin.is_car_rig_generated(context) | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def poll(cls, context):
return RIGACAR_PT_mixin.is_car_rig_generated(context) | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def menu_entries(menu, context):
menu.layout.operator(car_rig.OBJECT_OT_armatureCarDeformationRig.bl_idname, text="Car (deformation rig)", icon='AUTO') | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def register():
bpy.types.VIEW3D_MT_armature_add.append(menu_entries)
for c in classes:
bpy.utils.register_class(c)
car_rig.register()
bake_operators.register() | digicreatures/rigacar | [
308,
41,
308,
35,
1506497977
] |
def __init__(self, json):
self.id = json['id']
self.slug = json['slug']
self.title = json['title']
self.presenters = json['presenters']
self.host = json['host']
self.embed_code = json['embed_code'] | watsonbox/xbmc-confreaks | [
14,
1,
14,
4,
1337444066
] |
def url(self):
return 'plugin://plugin.video.%s/?action=play_video&videoid=%s' % (self.host, self.embed_code) | watsonbox/xbmc-confreaks | [
14,
1,
14,
4,
1337444066
] |
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1161, 620)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.channel1Check = QtWidgets.QCheckBox(self.centralwidget)
self.channe... | kusti8/hue-plus | [
234,
20,
234,
32,
1471624891
] |
def __init__(
self, tokenizer: Optional[_Tokenizer] = None, **kwargs: Any | chrislit/abydos | [
154,
26,
154,
63,
1398235847
] |
def sim(self, src: str, tar: str) -> float:
"""Return the Roberts similarity of two strings.
Parameters
----------
src : str
Source string (or QGrams/Counter objects) for comparison
tar : str
Target string (or QGrams/Counter objects) for comparison
... | chrislit/abydos | [
154,
26,
154,
63,
1398235847
] |
def forwards(self, orm):
# Changing field 'Graph.slug'
db.alter_column('muparse_graph', 'slug', self.gf('django.db.models.fields.SlugField')(max_length=128, null=True))
# Adding index on 'Graph', fields ['slug']
db.create_index('muparse_graph', ['slug'])
# Changing field 'Grap... | grnet/mupy | [
7,
3,
7,
2,
1410258462
] |
def format_component_title(name):
return name.replace('_', ' ').capitalize() | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def get_zip_content(path):
file_names = None
try:
zf = zipfile.ZipFile(path, 'r')
file_names = zf.namelist()
return file_names
except Exception as e:
return False | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def get_review_status_list(key):
status_list = ['Pending', 'Waiting for Admin Review', 'Waiting for Domain Review', 'Waiting for Quality Review', 'Accepted', 'Need Improvement', 'Not Required']
return status_list[key]; | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def get_review_status_symbol(key):
status_list = ['fa fa-1 fa-minus-circle review-pending-upload', 'fa fa-1 fa-check-circle review-admin-review', 'fa fa-1 fa-check-circle review-domain-review', 'fa fa-1 fa-check-circle review-quality-review', 'fa fa-1 fa-check-circle review-accepted', 'fa fa-1 fa-times-circle review-p... | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def get_last_video_upload_time(key):
rec = None
try:
rec = ContributorLog.objects.filter(tutorial_resource_id = key.id).order_by('-created')[0]
tmpdt = key.updated
for tmp in rec:
tmpdt = rec.created
return tmpdt
except:
return key.updated | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def get_missing_component_reply(mcid):
rows = TutorialMissingComponentReply.objects.filter(missing_component_id = mcid)
replies = ''
for row in rows:
replies += '<p>' + row.reply_message + '<b> -' + row.user.username + '</b></p>'
if replies:
replies = '<br /><b>Replies:</b>' + replies
... | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def instruction_sheet(foss, lang):
file_path = settings.MEDIA_ROOT + 'videos/' + str(foss.id) + '/' + foss.foss.replace(' ', '-') + '-Instruction-Sheet-' + lang.name + '.pdf'
if lang.name != 'English':
if os.path.isfile(file_path):
file_path = settings.MEDIA_URL + 'videos/' + str(foss.id) + ... | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def installation_sheet(foss, lang):
file_path = settings.MEDIA_ROOT + 'videos/' + str(foss.id) + '/' + foss.foss.replace(' ', '-') + '-Installation-Sheet-' + lang.name + '.pdf'
if lang.name != 'English':
if os.path.isfile(file_path):
file_path = settings.MEDIA_URL + 'videos/' + str(foss.id) ... | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def brochure(foss, lang):
file_path = settings.MEDIA_ROOT + 'videos/' + str(foss.id) + '/' + foss.foss.replace(' ', '-') + '-Brochure-' + lang.name + '.pdf'
if lang.name != 'English':
if os.path.isfile(file_path):
file_path = settings.MEDIA_URL + 'videos/' + str(foss.id) + '/' + foss.foss.re... | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def get_thumb_path(row, append_str):
path = settings.MEDIA_URL + 'videos/' + str(row.foss_id) + '/' + str(row.id) + '/' + row.tutorial.replace(' ', '-') + '-' + append_str + '.png'
return path | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def get_video_visits(tr):
tr.hit_count = tr.hit_count + 1
tr.save()
return tr.hit_count | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def get_prerequisite_from_td(td, lang):
try:
tr_rec = TutorialResource.objects.get(Q(status = 1) | Q(status = 2), tutorial_detail = td, language_id = lang.id)
return tr_rec.id
except:
if lang.name != 'English':
try:
tr_rec = TutorialResource.objects.get(Q(stat... | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
def tutorialsearch():
context = {
'form': TutorialSearchForm()
}
return context | Spoken-tutorial/spoken-website | [
9,
44,
9,
83,
1393308162
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.